Skip to content
Commit 797b1d9f authored by Ziyang Xuan's avatar Ziyang Xuan Committed by Greg Kroah-Hartman
Browse files

can: can327: can327_feed_frame_to_netdev(): fix potential skb leak when netdev is down

commit 8fa452cf upstream.

In can327_feed_frame_to_netdev(), it did not free the skb when netdev
is down, and all callers of can327_feed_frame_to_netdev() did not free
allocated skb too. That would trigger skb leak.

Fix it by adding kfree_skb() in can327_feed_frame_to_netdev() when netdev
is down. Not tested, just compiled.

Fixes: 43da2f07

 ("can: can327: CAN/ldisc driver for ELM327 based OBD-II adapters")
Signed-off-by: default avatarZiyang Xuan <william.xuanziyang@huawei.com>
Link: https://lore.kernel.org/all/20221110061437.411525-1-william.xuanziyang@huawei.com


Reviewed-by: default avatarMax Staudt <max@enpas.org>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7c80ce85
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment