Commit 45d97cac authored by Dan Carpenter's avatar Dan Carpenter Committed by Ma Wupeng
Browse files

Bluetooth: qca: Fix error code in qca_read_fw_build_info()

stable inclusion
from stable-v6.6.33
commit dfde465d89073b41d197b41e70fe762fd1306346
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IAD6H2

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=dfde465d89073b41d197b41e70fe762fd1306346



--------------------------------

[ 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: default avatarDan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: default avatarJohan Hovold <johan+linaro@kernel.org>
Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarWang Hai <wanghai38@huawei.com>
parent 3402bf66
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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);