public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: Johan Hovold <johan+linaro@kernel.org>,
	Marcel Holtmann <marcel@holtmann.org>,
	Luiz Augusto von Dentz <luiz.dentz@gmail.com>,
	linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] Bluetooth: qca: Fix error code in qca_read_fw_build_info()
Date: Mon, 6 May 2024 09:49:58 +0200	[thread overview]
Message-ID: <ZjiLphwtH2RvUChu@hovoldconsulting.com> (raw)
In-Reply-To: <515be96c-4c44-44d5-891f-fe57275e9f47@moroto.mountain>

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@vger.kernel.org	# 5.12

> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>

Reviewed-by: Johan Hovold <johan+linaro@kernel.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

  parent reply	other threads:[~2024-05-06  7:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-04 11:25 [PATCH] Bluetooth: qca: Fix error code in qca_read_fw_build_info() Dan Carpenter
2024-05-04 11:55 ` bluez.test.bot
2024-05-06  7:49 ` Johan Hovold [this message]
2024-05-06 17:00 ` [PATCH] " patchwork-bot+bluetooth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZjiLphwtH2RvUChu@hovoldconsulting.com \
    --to=johan@kernel.org \
    --cc=dan.carpenter@linaro.org \
    --cc=johan+linaro@kernel.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luiz.dentz@gmail.com \
    --cc=marcel@holtmann.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox