Re: [PATCH] Staging: irda: Do not check for NOT NULL before kfree()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx> 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@xxxxxxxxx>
> Please read drivers/staging/irda/TODO

Oh, I was not knowing about it.

Thank you
> 
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux