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: cda0d6a ("Bluetooth: qca: fix info leak when fetching fw build id")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Johan Hovold <johan+linaro@kernel.org>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
  • Loading branch information
Dan Carpenter authored and Vudentz committed May 14, 2024
1 parent ea9e148 commit a189f0e
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 a189f0e

Please sign in to comment.