From: Callan McClish <mcclishcallan@gmail.com>
To: linux-staging@lists.linux.dev
Cc: gregkh@linuxfoundation.org, Callan McClish <mcclishcallan@gmail.com>
Subject: [PATCH] staging: rtl8723bs: remove unnecessary NULL check before kfree
Date: Sun, 20 Sep 2026 16:30:40 -0700 [thread overview]
Message-ID: <20260920233053.2311209-1-mcclishcallan@gmail.com> (raw)
kfree(NULL) is a safe operation and an explicit NULL check is redundant,
therefore it should be omitted.
Detected by checkpatch.
Signed-off-by: Callan McClish <mcclishcallan@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 81d9e713fc12..6aaa07813d46 100644
--- a/drivers/staging/rtl8723bs/core/rtw_xmit.c
+++ b/drivers/staging/rtl8723bs/core/rtw_xmit.c
@@ -1748,10 +1748,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;
- }
if (pxmitframe->ext_tag == 0)
queue = &pxmitpriv->free_xmit_queue;
--
2.55.0
next reply other threads:[~2026-09-20 23:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-20 23:30 Callan McClish [this message]
2026-09-21 12:57 ` [PATCH] staging: rtl8723bs: remove unnecessary NULL check before kfree Dan Carpenter
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=20260920233053.2311209-1-mcclishcallan@gmail.com \
--to=mcclishcallan@gmail.com \
--cc=gregkh@linuxfoundation.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