]> git.proxmox.com Git - mirror_ubuntu-bionic-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)
committerKhalid Elmously <khalid.elmously@canonical.com>
Wed, 4 Sep 2019 06:16:38 +0000 (02:16 -0400)
commit807ef52707aba9ad9f006b1a434707c43ef244c2
tree4f26e78378b9eee15b5153302c7a556fcb327080
parentaab0fda29b67a0048d924690fb949f7e3f9f1a94
can: peak_usb: fix potential double kfree_skb()

BugLink: https://bugs.launchpad.net/bugs/1840520
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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/net/can/usb/peak_usb/pcan_usb_core.c