]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
can: ems_usb: ems_usb_start_xmit(): fix double dev_kfree_skb() in error path
authorHangyu Hua <hbh25y@gmail.com>
Mon, 28 Feb 2022 08:36:39 +0000 (16:36 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Apr 2022 07:08:10 +0000 (09:08 +0200)
commit29d967c18737ce04f372831c4542e71da1a8d5c8
treec33e03f1778470e7fd292edf3a6dd9ac934dd278
parente4bc03a96374556962a3ba560ca5c9f8c99a72c9
can: ems_usb: ems_usb_start_xmit(): fix double dev_kfree_skb() in error path

commit c70222752228a62135cee3409dccefd494a24646 upstream.

There is no need to call dev_kfree_skb() when usb_submit_urb() fails
beacause can_put_echo_skb() deletes the original skb and
can_free_echo_skb() deletes the cloned skb.

Link: https://lore.kernel.org/all/20220228083639.38183-1-hbh25y@gmail.com
Fixes: 702171adeed3 ("ems_usb: Added support for EMS CPC-USB/ARM7 CAN/USB interface")
Cc: stable@vger.kernel.org
Cc: Sebastian Haas <haas@ems-wuensche.com>
Signed-off-by: Hangyu Hua <hbh25y@gmail.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