staging/comedi/drivers/das1800.c: 2 * minor quibble

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

 




Hello there,

I just ran the sourceforge tool cppcheck over the source code of the
new Linux kernel 2.6.34-rc1

It said

[./staging/comedi/drivers/das1800.c:799]: (style) Redundant condition. It is safe to deallocate a NULL pointer
[./staging/comedi/drivers/das1800.c:801]: (style) Redundant condition. It is safe to deallocate a NULL pointer

The source code is

                if (devpriv->ai_buf0)
                        kfree(devpriv->ai_buf0);
                if (devpriv->ai_buf1)
                        kfree(devpriv->ai_buf1);


Proposed patch file attached.

Regards

David Binderman

 		 	   		  
_________________________________________________________________
Tell us your greatest, weirdest and funniest Hotmail stories
http://clk.atdmt.com/UKM/go/195013117/direct/01/
Signed-off-by: David Binderman <dcb314@xxxxxxxxxxx>

--- staging/comedi/drivers/das1800.c.sav	2010-03-19 09:23:42.000000000 +0000
+++ staging/comedi/drivers/das1800.c	2010-03-19 09:23:57.000000000 +0000
@@ -796,10 +796,8 @@ static int das1800_detach(struct comedi_
 			free_dma(devpriv->dma0);
 		if (devpriv->dma1)
 			free_dma(devpriv->dma1);
-		if (devpriv->ai_buf0)
-			kfree(devpriv->ai_buf0);
-		if (devpriv->ai_buf1)
-			kfree(devpriv->ai_buf1);
+		kfree(devpriv->ai_buf0);
+		kfree(devpriv->ai_buf1);
 	}
 
 	printk("comedi%d: %s: remove\n", dev->minor,
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/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