]> www.infradead.org Git - users/dwmw2/linux.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 16 Aug 2019 08:10:58 +0000 (10:10 +0200)
commit44879f85b39bda2b7eac419702db5cc38aa1b784
tree922f9a451ca660e35f1f37eaab14a5717fcb9aa6
parenta4b88383cc79564853360c2cd6ba87420d2f3e3a
can: peak_usb: fix potential double kfree_skb()

commit fee6a8923ae0d318a7f7950c6c6c28a96cea099b upstream.

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: bb4785551f64 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/can/usb/peak_usb/pcan_usb_core.c