diff options
author | Dan Carpenter <dan.carpenter@linaro.org> | 2024-05-04 14:25:43 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-06-12 11:11:55 +0200 |
commit | dfde465d89073b41d197b41e70fe762fd1306346 (patch) | |
tree | 6f1b096e1e3bc19b76665da43b34f9a8779405e5 /drivers/bluetooth | |
parent | e231034377bc9dc457f34f9dede20abe11ef3419 (diff) | |
download | linux-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.c | 4 |
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); |