Commit 71f8e707 authored by Dinghao Liu's avatar Dinghao Liu Committed by Marcel Holtmann
Browse files

Bluetooth: hci_qca: Fix memleak in qca_controller_memdump



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: default avatarDinghao Liu <dinghao.liu@zju.edu.cn>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent f272f185
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1024,7 +1024,9 @@ static void qca_controller_memdump(struct work_struct *work)
			dump_size = __le32_to_cpu(dump->dump_size);
			if (!(dump_size)) {
				bt_dev_err(hu->hdev, "Rx invalid memdump size");
				kfree(qca_memdump);
				kfree_skb(skb);
				qca->qca_memdump = NULL;
				mutex_unlock(&qca->hci_memdump_lock);
				return;
			}