提交 ac940701 编写于 作者: D Dinghao Liu 提交者: Zheng Zengkai

Bluetooth: hci_qca: Fix memleak in qca_controller_memdump

stable inclusion
from stable-5.10.20
commit 601899cec0a3a84341d70289cd014d358b00f808
bugzilla: 50608

--------------------------------

[ Upstream commit 71f8e707 ]

When __le32_to_cpu() fails, qca_memdump should be freed
just like when vmalloc() fails.

Fixes: d841502c ("Bluetooth: hci_qca: Collect controller memory dump during SSR")
Signed-off-by: NDinghao Liu <dinghao.liu@zju.edu.cn>
Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 042eb2cf
...@@ -1020,7 +1020,9 @@ static void qca_controller_memdump(struct work_struct *work) ...@@ -1020,7 +1020,9 @@ static void qca_controller_memdump(struct work_struct *work)
dump_size = __le32_to_cpu(dump->dump_size); dump_size = __le32_to_cpu(dump->dump_size);
if (!(dump_size)) { if (!(dump_size)) {
bt_dev_err(hu->hdev, "Rx invalid memdump size"); bt_dev_err(hu->hdev, "Rx invalid memdump size");
kfree(qca_memdump);
kfree_skb(skb); kfree_skb(skb);
qca->qca_memdump = NULL;
mutex_unlock(&qca->hci_memdump_lock); mutex_unlock(&qca->hci_memdump_lock);
return; return;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册