[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20210129020827.27784-1-zjp734690220@163.com>
Date: Fri, 29 Jan 2021 10:08:27 +0800
From: zjp734690220@....com
To: marcel@...tmann.org, johan.hedberg@...il.com, luiz.dentz@...il.com
Cc: linux-bluetooth@...r.kernel.org, linux-kernel@...r.kernel.org,
zhongjupeng <zhongjupeng@...ong.com>
Subject: [PATCH] bluetooth: fix memory leak in btusb_mtk_wmt_recv
From: zhongjupeng <zhongjupeng@...ong.com>
In btusb_mtk_wmt_recv if skb_clone fails, the alocated skb should be
released.
Signed-off-by: zhongjupeng <zhongjupeng@...ong.com>
---
drivers/bluetooth/btusb.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index ffec6bc..cf21bba 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -3217,8 +3217,10 @@ static void btusb_mtk_wmt_recv(struct urb *urb)
*/
if (test_bit(BTUSB_TX_WAIT_VND_EVT, &data->flags)) {
data->evt_skb = skb_clone(skb, GFP_ATOMIC);
- if (!data->evt_skb)
+ if (!data->evt_skb) {
+ kfree_skb(skb);
goto err_out;
+ }
}
err = hci_recv_frame(hdev, skb);
--
1.9.1
Powered by blists - more mailing lists