Skip to content

Commit a189f0e

Browse files
Dan CarpenterVudentz
Dan Carpenter
authored andcommitted
Bluetooth: qca: Fix error code in qca_read_fw_build_info()
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 <[email protected]> Reviewed-by: Johan Hovold <[email protected]> Signed-off-by: Luiz Augusto von Dentz <[email protected]>
1 parent ea9e148 commit a189f0e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/bluetooth/btqca.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,10 @@ static int qca_read_fw_build_info(struct hci_dev *hdev)
136136
}
137137

138138
build_label = kstrndup(&edl->data[1], build_lbl_len, GFP_KERNEL);
139-
if (!build_label)
139+
if (!build_label) {
140+
err = -ENOMEM;
140141
goto out;
142+
}
141143

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

0 commit comments

Comments
 (0)