Bluetooth: btusb: Fix memory leak in btusb_mtk_wmt_recv
authorJupeng Zhong <zhongjupeng@yulong.com>
Tue, 2 Feb 2021 01:39:13 +0000 (09:39 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Mar 2021 10:37:27 +0000 (11:37 +0100)
commit9bb8acd6aa963a37d5330c15be0629e634549043
tree5498fe1526306956a4a91bf0bef0fe2a2b39d442
parent276d6b35f3bc0c5985b3a452d0f06cf0c4ffe84f
Bluetooth: btusb: Fix memory leak in btusb_mtk_wmt_recv

[ Upstream commit de71a6cb4bf24d8993b9ca90d1ddb131b60251a1 ]

In btusb_mtk_wmt_recv if skb_clone fails, the alocated skb should be
released.

Omit the labels “err_out” and “err_free_skb” in this function
implementation so that the desired exception handling code
would be directly specified in the affected if branches.

Fixes: a1c49c434e15 ("btusb: Add protocol support for MediaTek MT7668U USB devices")
Signed-off-by: Jupeng Zhong <zhongjupeng@yulong.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/bluetooth/btusb.c