Skip to content

Commit 40d442f

Browse files
jhovoldVudentz
authored andcommitted
Bluetooth: qca: fix firmware check error path
A recent commit fixed the code that parses the firmware files before downloading them to the controller but introduced a memory leak in case the sanity checks ever fail. Make sure to free the firmware buffer before returning on errors. Fixes: f905ae0 ("Bluetooth: qca: add missing firmware sanity checks") Cc: [email protected] # 4.19 Signed-off-by: Johan Hovold <[email protected]> Signed-off-by: Luiz Augusto von Dentz <[email protected]>
1 parent adf0398 commit 40d442f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/bluetooth/btqca.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ static int qca_download_firmware(struct hci_dev *hdev,
605605

606606
ret = qca_tlv_check_data(hdev, config, data, size, soc_type);
607607
if (ret)
608-
return ret;
608+
goto out;
609609

610610
segment = data;
611611
remain = size;

0 commit comments

Comments
 (0)