OSDN Git Service

can: ems_usb: Fix possible tx overflow
authorGerhard Uttenthaler <uttenthaler@ems-wuensche.com>
Tue, 22 Dec 2015 16:29:16 +0000 (17:29 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Mar 2016 23:07:10 +0000 (15:07 -0800)
commitf847ff0db6da0b42acb7447f8629dd2a33ddfe24
tree37109cd56cf84f2e4e6d1e9deddc02e926648f12
parent5c8a03a351257ae175d57c9c06f57ab95fc99db3
can: ems_usb: Fix possible tx overflow

commit 90cfde46586d2286488d8ed636929e936c0c9ab2 upstream.

This patch fixes the problem that more CAN messages could be sent to the
interface as could be send on the CAN bus. This was more likely for slow baud
rates. The sleeping _start_xmit was woken up in the _write_bulk_callback. Under
heavy TX load this produced another bulk transfer without checking the
free_slots variable and hence caused the overflow in the interface.

Signed-off-by: Gerhard Uttenthaler <uttenthaler@ems-wuensche.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/can/usb/ems_usb.c