Re: [PATCH v3] Staging: bcm: Fix potential buffer overflow and style cleanups

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

 



On Tue, Jan 25, 2011 at 05:48:36AM +1000, Stephen Hemminger wrote:
> > +		pTarang->RxCntrlMsgBitMask = RxCntrlMsgBitMask;
> > +		break;
> >  			case IOCTL_BCM_GET_DEVICE_DRIVER_INFO:
> >  			{
> >  				DEVICE_DRIVER_INFO DevInfo;
> 
> 1. Your indentation looks different than original code. 

Yes, but it's the surrounding code which is wrong, and not even in a
consistent way.  :/  We normally just ignore the surrounding code when
it's that hopeless.

It doesn't matter either way.  The white space for the entire file will
need to be redone in a later patch.

> 2. Make RxCntrlMsgBitMask a block local variable like the rest of the
>    code here.

Yes.

> 3. Initialization is to zero is actually bad idea in this kind of code because
>    automated tools can catch uninitialized variable usage and cause warning but
>    by setting it to zero you defeat that.

True.

regards,
dan carpenter
_______________________________________________
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