From: Shreeya Patel <shreeya.patel23498@gmail.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: devel@driverdev.osuosl.org, gregkh@linuxfoundation.org,
samuel@sortiz.org, linux-kernel@vger.kernel.org,
netdev@vger.kernel.org
Subject: Re: [PATCH] Staging: irda: Do not check for NOT NULL before kfree()
Date: Tue, 19 Dec 2017 00:57:26 +0530 [thread overview]
Message-ID: <1513625246.3434.0.camel@gmail.com> (raw)
In-Reply-To: <20171218112038.15626e20@xeon-e3>
On Mon, 2017-12-18 at 11:20 -0800, Stephen Hemminger wrote:
> On Tue, 19 Dec 2017 00:41:30 +0530
> Shreeya Patel <shreeya.patel23498@gmail.com> wrote:
>
> >
> > Do not check for NOT NULL before calling kfree because if the
> > pointer is NULL, no action occurs.
> > Done using the following semantic patch by coccinelle.
> >
> > @@
> > expression ptr;
> > @@
> >
> > - if (ptr != NULL) {
> > kfree(ptr);
> > ptr = NULL;
> > - }
> >
> > The semantic patch has the effect of adding an assignment
> > of ptr to NULL in the case where ptr is NULL already.
> >
> > Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com>
> Please read drivers/staging/irda/TODO
Oh, I was not knowing about it.
Thank you
>
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
prev parent reply other threads:[~2017-12-18 19:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-18 19:11 [PATCH] Staging: irda: Do not check for NOT NULL before kfree() Shreeya Patel
2017-12-18 19:20 ` Stephen Hemminger
2017-12-18 19:27 ` Shreeya Patel [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=1513625246.3434.0.camel@gmail.com \
--to=shreeya.patel23498@gmail.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=samuel@sortiz.org \
--cc=stephen@networkplumber.org \
/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).