public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@linaro.org>
To: Ethan Tidmore <ethantidmore06@gmail.com>
Cc: gregkh@linuxfoundation.org, straube.linux@gmail.com,
	hansg@kernel.org, linux-staging@lists.linux.dev,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH v1] staging: rtl8723bs: fix null dereference in find_network
Date: Mon, 2 Feb 2026 11:38:07 +0300	[thread overview]
Message-ID: <aYBib7CfThRZ28wm@stanley.mountain> (raw)
In-Reply-To: <20260202063808.664468-1-ethantidmore06@gmail.com>

On Mon, Feb 02, 2026 at 12:38:08AM -0600, Ethan Tidmore wrote:
> The pwlan variable has the possibility of returning NULL and is not
> checked for NULL and then later dereferenced.
> 
> Fixes: 554c0a3abf21 ("staging: Add rtl8723bs sdio wifi driver")
> Cc: stable@vger.kernel.org
> Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com>
> ---
>  drivers/staging/rtl8723bs/core/rtw_mlme.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
> index f81a29cd6a78..29dd0b56223a 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
> @@ -835,8 +835,11 @@ static void find_network(struct adapter *adapter)
>  	struct wlan_network *tgt_network = &pmlmepriv->cur_network;
>  
>  	pwlan = rtw_find_network(&pmlmepriv->scanned_queue, tgt_network->network.mac_address);
> -	if (pwlan)
> -		pwlan->fixed = false;
> +

Delete this blank line.

regards,
dan carpenter

> +	if (!pwlan)
> +		return;
> +
> +	pwlan->fixed = false;
>  
>  	if (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) &&
>  	    (adapter->stapriv.asoc_sta_count == 1))
> -- 
> 2.52.0
> 

  reply	other threads:[~2026-02-02  8:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-02  6:38 [PATCH v1] staging: rtl8723bs: fix null dereference in find_network Ethan Tidmore
2026-02-02  8:38 ` Dan Carpenter [this message]
2026-02-02  8:38 ` Greg KH

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=aYBib7CfThRZ28wm@stanley.mountain \
    --to=dan.carpenter@linaro.org \
    --cc=ethantidmore06@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hansg@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=stable@vger.kernel.org \
    --cc=straube.linux@gmail.com \
    /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