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
[ Upstream commit a189f0e ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Dan Carpenter authored and Sasha Levin committed May 27, 2024
1 parent 03e3db6 commit 63ab73c
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 @@ -148,8 +148,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 63ab73c

Please sign in to comment.