]> git.baikalelectronics.ru Git - kernel.git/commit
can: peak_usb: fix potential double kfree_skb()
authorStephane Grosjean <s.grosjean@peak-system.com>
Fri, 5 Jul 2019 13:32:16 +0000 (15:32 +0200)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Wed, 24 Jul 2019 09:16:31 +0000 (11:16 +0200)
commit2e85aba475d8d5d6f12970a2b095dd842b18a2b5
tree71cb3eb30d31075dc22ccc2192415afa4aab6344
parentcd98073facde041af78bd81c591225c56cafaf73
can: peak_usb: fix potential double kfree_skb()

When closing the CAN device while tx skbs are inflight, echo skb could
be released twice. By calling close_candev() before unlinking all
pending tx urbs, then the internal echo_skb[] array is fully and
correctly cleared before the USB write callback and, therefore,
can_get_echo_skb() are called, for each aborted URB.

Fixes: 188afe36462c ("can: usb: PEAK-System Technik USB adapters driver core")
Signed-off-by: Stephane Grosjean <s.grosjean@peak-system.com>
Cc: linux-stable <stable@vger.kernel.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/usb/peak_usb/pcan_usb_core.c