mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arend van Spriel <arend.vanspriel@broadcom.com>
To: Li Qiang <liqiang01@kylinos.cn>,
	linux-wireless@vger.kernel.org, brcm80211@lists.linux.dev,
	brcm80211-dev-list.pdl@broadcom.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] wifi: brcmfmac: Add null pointer check to brcmf_acpi_probe
Date: Thu, 30 Oct 2025 14:27:05 +0100	[thread overview]
Message-ID: <17ed1078-772e-4c01-ba7c-63c58d89c0d9@broadcom.com> (raw)
In-Reply-To: <20251015071607.96415-1-liqiang01@kylinos.cn>

On 10/15/2025 9:16 AM, Li Qiang wrote:
> devm_kasprintf() returns a pointer to dynamically allocated memory
> which can be NULL upon failure.

Thanks. However, it does not make sense to just bail out. 
settings->board_type will still be NULL and apparently that is not an 
issue. It is used to fill the firmware request (see struct 
brcmf_fw_request [1]) which is done for PCIe devices in 
brcmf_pcie_prepare_fw_request() [2].

So struct brcmf_fw_request::board_types array may hold NULL pointers 
which is not an issue.

So this patch does not solve a problem.

Regards,
Arend

[1] 
https://elixir.bootlin.com/linux/v6.17.5/source/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.h#L67
[2] 
https://elixir.bootlin.com/linux/v6.17.5/source/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c#L2264

> Fixes: 0f485805d008a ("wifi: brcmfmac: acpi: Add support for fetching Apple ACPI properties")
> Signed-off-by: Li Qiang <liqiang01@kylinos.cn>
> ---
>   drivers/net/wireless/broadcom/brcm80211/brcmfmac/acpi.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/acpi.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/acpi.c
> index c4a54861bfb4..f8f6433bdf69 100644
> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/acpi.c
> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/acpi.c
> @@ -25,6 +25,8 @@ void brcmf_acpi_probe(struct device *dev, enum brcmf_bus_type bus_type,
>   		settings->board_type = devm_kasprintf(dev, GFP_KERNEL,
>   						      "apple,%s",
>   						      o->string.pointer);
> +		if (!settings->board_type)
> +			return;
>   	} else {
>   		brcmf_dbg(INFO, "No ACPI module-instance\n");
>   		return;


      parent reply	other threads:[~2025-10-30 13:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-15  7:16 Li Qiang
2025-10-15 11:24 ` Markus Elfring
2025-10-30 13:27 ` Arend van Spriel [this message]

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=17ed1078-772e-4c01-ba7c-63c58d89c0d9@broadcom.com \
    --to=arend.vanspriel@broadcom.com \
    --cc=brcm80211-dev-list.pdl@broadcom.com \
    --cc=brcm80211@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=liqiang01@kylinos.cn \
    /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

all inboxes | Powered by JetHome®