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:06:19 +0000 (15:06 -0800)
commitfadc5c1769ba24cd8498359d93e31408b0e0fbb9
treef58ba5ccc98c5770215d86d712cf97dfaa15cc7c
parent86d80ecd4f96b63103abfd1269855a8a3b9d47cc
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