From: Hans de Goede <hdegoede@redhat.com>
To: Longji Guo <guolongji@uniontech.com>,
gregkh@linuxfoundation.org, fabioaiuto83@gmail.com
Cc: ross.schm.dev@gmail.com, marcocesati@gmail.com,
fmdefrancesco@gmail.com, linux-staging@lists.linux.dev,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: rtl8723bs: remove meaningless pstat->passoc_req check in OnAssocReq()
Date: Mon, 27 Sep 2021 13:51:16 +0200 [thread overview]
Message-ID: <6bec8a71-2233-9549-ab5e-1b1f62e2f488@redhat.com> (raw)
In-Reply-To: <20210927114925.15940-1-guolongji@uniontech.com>
Hi,
On 9/27/21 1:49 PM, Longji Guo wrote:
> kfree(NULL) is safe and the check 'if (pstat->passoc_req)' before kfree
> is not necessary.
>
> Signed-off-by: Longji Guo <guolongji@uniontech.com>
Thanks, patch looks good to me:
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Next time please mark a new (v2) version as such please by changing
the [PATCH] in the subject to [PATCH v2].
You can do this, by for example doing:
git format-patch -v2 HEAD~
git send-email v2-0001-.....patch
Regards,
Hans
> ---
> drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 8 ++------
> 1 file changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
> index 375d2a742dd2..51390a30fa55 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
> @@ -1344,12 +1344,8 @@ unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame)
> issue_asocrsp(padapter, status, pstat, WIFI_REASSOCRSP);
>
> spin_lock_bh(&pstat->lock);
> - if (pstat->passoc_req) {
> - kfree(pstat->passoc_req);
> - pstat->passoc_req = NULL;
> - pstat->assoc_req_len = 0;
> - }
> -
> + kfree(pstat->passoc_req);
> + pstat->assoc_req_len = 0;
> pstat->passoc_req = rtw_zmalloc(pkt_len);
> if (pstat->passoc_req) {
> memcpy(pstat->passoc_req, pframe, pkt_len);
>
next parent reply other threads:[~2021-09-27 11:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20210927114925.15940-1-guolongji@uniontech.com>
2021-09-27 11:51 ` Hans de Goede [this message]
[not found] <20210927033056.27503-1-guolongji@uniontech.com>
2021-09-27 8:27 ` Hans de Goede
2021-09-27 15:24 ` Greg KH
[not found] <20210926103014.30088-1-guolongji@uniontech.com>
2021-09-26 11:10 ` Fabio M. De Francesco
2021-09-26 11:21 ` 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=6bec8a71-2233-9549-ab5e-1b1f62e2f488@redhat.com \
--to=hdegoede@redhat.com \
--cc=fabioaiuto83@gmail.com \
--cc=fmdefrancesco@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=guolongji@uniontech.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=marcocesati@gmail.com \
--cc=ross.schm.dev@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
Powered by JetHome