linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: YueHaibing <yuehaibing@huawei.com>
To: <gregkh@linuxfoundation.org>, <jarias.linux@gmail.com>,
	<julia.lawall@lip6.fr>, <colin.king@canonical.com>,
	<hdegoede@redhat.com>, <hariprasad.kelam@gmail.com>,
	<nachukannan@gmail.com>, <pakki001@umn.edu>,
	<hardiksingh.k@gmail.com>, <nishkadg.linux@gmail.com>,
	<dan.carpenter@oracle.com>
Cc: <devel@driverdev.osuosl.org>, <linux-kernel@vger.kernel.org>,
	YueHaibing <yuehaibing@huawei.com>
Subject: [PATCH v2 -next] staging: rtl8723bs: remove unnecessary null check
Date: Tue, 15 Oct 2019 19:55:11 +0800	[thread overview]
Message-ID: <20191015115511.26560-1-yuehaibing@huawei.com> (raw)
In-Reply-To: <20191015114053.23496-1-yuehaibing@huawei.com>

Null check before kfree is redundant, so remove it.
This is detected by coccinelle.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
v2: remove unnecessary 'hwxmits'
---
 drivers/staging/rtl8723bs/core/rtw_xmit.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_xmit.c b/drivers/staging/rtl8723bs/core/rtw_xmit.c
index 7011c2a..6d193f1 100644
--- a/drivers/staging/rtl8723bs/core/rtw_xmit.c
+++ b/drivers/staging/rtl8723bs/core/rtw_xmit.c
@@ -2206,12 +2206,9 @@ s32 rtw_alloc_hwxmits(struct adapter *padapter)
 
 void rtw_free_hwxmits(struct adapter *padapter)
 {
-	struct hw_xmit *hwxmits;
 	struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
 
-	hwxmits = pxmitpriv->hwxmits;
-	if (hwxmits)
-		kfree(hwxmits);
+	kfree(pxmitpriv->hwxmits);
 }
 
 void rtw_init_hwxmits(struct hw_xmit *phwxmit, sint entry)
-- 
2.7.4



      parent reply	other threads:[~2019-10-15 11:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-15 11:40 [PATCH -next] staging: rtl8723bs: remove unnecessary null check YueHaibing
2019-10-15 11:46 ` Dan Carpenter
2019-10-15 11:55 ` YueHaibing [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=20191015115511.26560-1-yuehaibing@huawei.com \
    --to=yuehaibing@huawei.com \
    --cc=colin.king@canonical.com \
    --cc=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hardiksingh.k@gmail.com \
    --cc=hariprasad.kelam@gmail.com \
    --cc=hdegoede@redhat.com \
    --cc=jarias.linux@gmail.com \
    --cc=julia.lawall@lip6.fr \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nachukannan@gmail.com \
    --cc=nishkadg.linux@gmail.com \
    --cc=pakki001@umn.edu \
    /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;
as well as URLs for NNTP newsgroup(s).