summaryrefslogtreecommitdiff
path: root/drivers/bluetooth
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@linaro.org>2024-05-04 14:25:43 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-06-12 11:11:55 +0200
commitdfde465d89073b41d197b41e70fe762fd1306346 (patch)
tree6f1b096e1e3bc19b76665da43b34f9a8779405e5 /drivers/bluetooth
parente231034377bc9dc457f34f9dede20abe11ef3419 (diff)
downloadlinux-rpi-dfde465d89073b41d197b41e70fe762fd1306346.tar.gz
linux-rpi-dfde465d89073b41d197b41e70fe762fd1306346.tar.bz2
linux-rpi-dfde465d89073b41d197b41e70fe762fd1306346.zip
Bluetooth: qca: Fix error code in qca_read_fw_build_info()
[ Upstream commit a189f0ee6685457528db7a36ded3085e5d13ddc3 ] Return -ENOMEM on allocation failure. Don't return success. Fixes: cda0d6a198e2 ("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>
Diffstat (limited to 'drivers/bluetooth')
-rw-r--r--drivers/bluetooth/btqca.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/bluetooth/btqca.c b/drivers/bluetooth/btqca.c
index 638074992c82..35fb26cbf229 100644
--- a/drivers/bluetooth/btqca.c
+++ b/drivers/bluetooth/btqca.c
@@ -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);