can: ems_usb: Fix possible tx overflow
authorGerhard Uttenthaler <uttenthaler@ems-wuensche.com>
Tue, 22 Dec 2015 16:29:16 +0000 (17:29 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Fri, 1 Apr 2016 00:54:34 +0000 (01:54 +0100)
commit045d2da9950528ec72f06fbb1cb2b981c2541ba0
tree25b91b5634dba091e80e669a589602dd7401f018
parent5215afa128adcfbf917fabc76bc69d35de4beab8
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: Ben Hutchings <ben@decadent.org.uk>
drivers/net/can/usb/ems_usb.c