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

Dan Carpenter error27 at gmail.com
Mon Jan 24 20:55:31 UTC 2011


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



More information about the devel mailing list