On Sun, Jun 08, 2014 at 11:45:28PM +0200, Rickard Strandqvist wrote:
> Array 'SigBuff' is filled incompletely.
> Someone forget to multiply for the sizeof type.
> 
> This was partly found using a static code analysis program called cppcheck.
> 

I took a look at code which uses MAX_RW_SIZE and it's really confused
about whether it is in bytes or number of ints.

This code is a real mess.  For example, look at the call to:

                        WriteToFlashWithoutSectorErase(Adapter,
                                                       SigBuff,
                                                       eISOWritePart,
                                                       sigOffset,
                                                       MAX_RW_SIZE);

If you look at it, that function says it takes int pointers but really
I think it wants u8 pointers.

I think this is the real fix here, to change
WriteToFlashWithoutSectorErase() to take char pointers and then make the
SigBuff buffer an array of u8.

I think this is the correct way to fix this code, but this driver is
very horrible so I could be wrong.  Please check.

regards,
dan carpenter

PS: These days I add everything to the TODO so we don't forget about it.

TODO-list: 2014-06-09: bcm: make SigBuff in BcmCopyISO() an array of u8.


_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to