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 v2] staging: rtl8723bs: remove meaningless pstat->passoc_req check in OnAssocReq()
Date: Wed, 29 Sep 2021 13:33:57 +0200 [thread overview]
Message-ID: <bc804876-4ca7-453a-b54d-bf7e1b067738@redhat.com> (raw)
In-Reply-To: <20210929110613.29979-1-guolongji@uniontech.com>
Hi,
On 9/29/21 1:06 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>
> ---
> Changes in v2:
> - Drop unnecessary "pstat->passoc_req = NULL;"
Thanks, patch looks good to me:
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
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-29 11:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20210929110613.29979-1-guolongji@uniontech.com>
2021-09-29 11:33 ` Hans de Goede [this message]
[not found] <20210928061319.4784-1-guolongji@uniontech.com>
2021-09-28 6:56 ` 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=bc804876-4ca7-453a-b54d-bf7e1b067738@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
all inboxes | Powered by JetHome®