]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
can: kvaser_usb: Don't free packets when tight on URBs
authorAhmed S. Darwish <ahmed.darwish@valeo.com>
Mon, 5 Jan 2015 17:49:10 +0000 (12:49 -0500)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Thu, 15 Jan 2015 15:58:00 +0000 (16:58 +0100)
commitb442723fcec445fb0ae1104888dd22cd285e0a91
tree76164d09f5a3830f7e6dddb1ec9a93129c28b903
parent47e3485af0a7a65547a3267021851d4ea6474d09
can: kvaser_usb: Don't free packets when tight on URBs

Flooding the Kvaser CAN to USB dongle with multiple reads and
writes in high frequency caused seemingly-random panics in the
kernel.

On further inspection, it seems the driver erroneously freed the
to-be-transmitted packet upon getting tight on URBs and returning
NETDEV_TX_BUSY, leading to invalid memory writes and double frees
at a later point in time.

Note:

Finding no more URBs/transmit-contexts and returning NETDEV_TX_BUSY
is a driver bug in and out of itself: it means that our start/stop
queue flow control is broken.

This patch only fixes the (buggy) error handling code; the root
cause shall be fixed in a later commit.

Acked-by: Olivier Sobrie <olivier@sobrie.be>
Signed-off-by: Ahmed S. Darwish <ahmed.darwish@valeo.com>
Cc: linux-stable <stable@vger.kernel.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/usb/kvaser_usb.c