Skip to content

Commit

Permalink
Bluetooth: qca: Fix error code in qca_read_fw_build_info()
Browse files Browse the repository at this point in the history
Return -ENOMEM on allocation failure.  Don't return success.

Fixes: e363169 ("Bluetooth: qca: fix info leak when fetching fw build id")
Signed-off-by: Dan Carpenter <[email protected]>
Reviewed-by: Johan Hovold <[email protected]>
Signed-off-by: Luiz Augusto von Dentz <[email protected]>
  • Loading branch information
Dan Carpenter authored and Vudentz committed May 6, 2024
1 parent f7bbc1e commit 0ae8d9b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/bluetooth/btqca.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,10 @@ static int qca_read_fw_build_info(struct hci_dev *hdev)
}

build_label = kstrndup(&edl->data[1], build_lbl_len, GFP_KERNEL);
if (!build_label)
if (!build_label) {
err = -ENOMEM;
goto out;
}

hci_set_fw_info(hdev, "%s", build_label);

Expand Down

0 comments on commit 0ae8d9b

Please sign in to comment.