[PATCH]: go7007/go7007-usb.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/go7007/go7007-usb.c:1251]: (style) Redundant condition. It is safe to deallocate a NULL poi
nter
[staging/go7007/go7007-usb.c:1258]: (style) Redundant condition. It is safe to deallocate a NULL poi
nter

The source code is

                        if (vurb->transfer_buffer)
                                kfree(vurb->transfer_buffer);

and

                       if (aurb->transfer_buffer)
                                kfree(aurb->transfer_buffer);

Proposed patch file attached.


Regards

David Binderman
 		 	   		  
_________________________________________________________________
Send us your Hotmail stories and be featured in our newsletter
http://clk.atdmt.com/UKM/go/195013117/direct/01/
Signed-off-by: David Binderman <dcb314@xxxxxxxxxxx>

--- staging/go7007/go7007-usb.c.sav	2010-03-19 09:33:18.000000000 +0000
+++ staging/go7007/go7007-usb.c	2010-03-19 09:33:28.000000000 +0000
@@ -1248,15 +1248,13 @@ static void go7007_usb_disconnect(struct
 		vurb = usb->video_urbs[i];
 		if (vurb) {
 			usb_kill_urb(vurb);
-			if (vurb->transfer_buffer)
-				kfree(vurb->transfer_buffer);
+			kfree(vurb->transfer_buffer);
 			usb_free_urb(vurb);
 		}
 		aurb = usb->audio_urbs[i];
 		if (aurb) {
 			usb_kill_urb(aurb);
-			if (aurb->transfer_buffer)
-				kfree(aurb->transfer_buffer);
+			kfree(aurb->transfer_buffer);
 			usb_free_urb(aurb);
 		}
 	}
_______________________________________________
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