[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZjiLphwtH2RvUChu@hovoldconsulting.com>
Date: Mon, 6 May 2024 09:49:58 +0200
From: Johan Hovold <johan@...nel.org>
To: Dan Carpenter <dan.carpenter@...aro.org>
Cc: Johan Hovold <johan+linaro@...nel.org>,
Marcel Holtmann <marcel@...tmann.org>,
Luiz Augusto von Dentz <luiz.dentz@...il.com>,
linux-bluetooth@...r.kernel.org, linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] Bluetooth: qca: Fix error code in
qca_read_fw_build_info()
On Sat, May 04, 2024 at 02:25:43PM +0300, Dan Carpenter wrote:
> Return -ENOMEM on allocation failure. Don't return success.
Thanks, Dan.
Fortunately this error path is never taken due to the small allocation
size, but if it were it would only lead to a debugfs attribute holding
the fw build id not being created.
That said, it should still be fixed of course even this can wait for
6.10-rc1.
> Fixes: cfc2a7747108 ("Bluetooth: qca: fix info leak when fetching fw build id")
This one should also have a matching:
Cc: stable@...r.kernel.org # 5.12
> Signed-off-by: Dan Carpenter <dan.carpenter@...aro.org>
Reviewed-by: Johan Hovold <johan+linaro@...nel.org>
> @@ -136,8 +136,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);
Johan
Powered by blists - more mailing lists