From: Dan Carpenter <dan.carpenter@oracle.com>
To: YueHaibing <yuehaibing@huawei.com>
Cc: 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, devel@driverdev.osuosl.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH -next] staging: rtl8723bs: remove unnecessary null check
Date: Tue, 15 Oct 2019 14:46:18 +0300 [thread overview]
Message-ID: <20191015114618.GG4774@kadam> (raw)
In-Reply-To: <20191015114053.23496-1-yuehaibing@huawei.com>
On Tue, Oct 15, 2019 at 07:40:53PM +0800, YueHaibing wrote:
> Null check before kfree is redundant, so remove it.
> This is detected by coccinelle.
>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
> drivers/staging/rtl8723bs/core/rtw_xmit.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/staging/rtl8723bs/core/rtw_xmit.c b/drivers/staging/rtl8723bs/core/rtw_xmit.c
> index 7011c2a..4597f4f 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_xmit.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_xmit.c
> @@ -2210,8 +2210,7 @@ void rtw_free_hwxmits(struct adapter *padapter)
> struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
>
> hwxmits = pxmitpriv->hwxmits;
> - if (hwxmits)
> - kfree(hwxmits);
> + kfree(hwxmits);
Just do:
kfree(pxmitpriv->hwxmits);
regards,
dan carpenter
next prev parent reply other threads:[~2019-10-15 11:46 UTC|newest]
Thread overview: 4+ 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 [this message]
2019-10-15 11:55 ` [PATCH v2 " YueHaibing
-- strict thread matches above, loose matches on Subject: below --
2019-10-10 15:33 [PATCH -next] staging: rtl8723bs: Remove " YueHaibing
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=20191015114618.GG4774@kadam \
--to=dan.carpenter@oracle.com \
--cc=colin.king@canonical.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 \
--cc=yuehaibing@huawei.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