From: Dan Carpenter <error27@gmail.com>
To: Andrezinrc <andrem.33333@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: rtl8723bs: remove redundant kfree check in rtw_xmit.c
Date: Fri, 19 Jun 2026 10:59:25 +0300 [thread overview]
Message-ID: <ajT23QSZDVNdD8M_@stanley.mountain> (raw)
In-Reply-To: <20260619022938.15691-1-andrem.33333@gmail.com>
On Thu, Jun 18, 2026 at 11:29:38PM -0300, Andrezinrc wrote:
> Remove the redundant null check before calling kfree. ccheckpatch
> reminds us that kfree(NULL) is safe and this check is not required.
>
> Signed-off-by: Andrezinrc <andrem.33333@gmail.com>
> ---
> drivers/staging/rtl8723bs/core/rtw_xmit.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/staging/rtl8723bs/core/rtw_xmit.c b/drivers/staging/rtl8723bs/core/rtw_xmit.c
> index 7bce0343d..92e818705 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_xmit.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_xmit.c
> @@ -1736,10 +1736,9 @@ s32 rtw_free_xmitframe(struct xmit_priv *pxmitpriv, struct xmit_frame *pxmitfram
> pxmitframe->pkt = NULL;
> }
>
> - if (pxmitframe->alloc_addr) {
> - kfree(pxmitframe->alloc_addr);
> + kfree(pxmitframe->alloc_addr);
> + if (pxmitframe->alloc_addr)
> goto check_pkt_complete;
> - }
The code was more readable before.
regards,
dan carpenter
prev parent reply other threads:[~2026-06-19 7:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-19 2:29 [PATCH] staging: rtl8723bs: remove redundant kfree check in rtw_xmit.c Andrezinrc
2026-06-19 7:59 ` Dan Carpenter [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=ajT23QSZDVNdD8M_@stanley.mountain \
--to=error27@gmail.com \
--cc=andrem.33333@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
/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