]> Git Repo - linux.git/commitdiff
Bluetooth: qca: fix firmware check error path
authorJohan Hovold <[email protected]>
Wed, 1 May 2024 06:37:40 +0000 (08:37 +0200)
committerLuiz Augusto von Dentz <[email protected]>
Fri, 3 May 2024 17:05:55 +0000 (13:05 -0400)
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: f905ae0be4b7 ("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]>
drivers/bluetooth/btqca.c

index 8d8a664620a360c1a07b9329e69d0c3d529a9d32..638074992c829b71b5f6682a39b850c77757757a 100644 (file)
@@ -605,7 +605,7 @@ static int qca_download_firmware(struct hci_dev *hdev,
 
        ret = qca_tlv_check_data(hdev, config, data, size, soc_type);
        if (ret)
-               return ret;
+               goto out;
 
        segment = data;
        remain = size;
This page took 0.050485 seconds and 4 git commands to generate.