[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20140609140738.GD5500@mwanda>
Date: Mon, 9 Jun 2014 17:09:51 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Lisa Nguyen <lisa@...apiadmin.com>, devel@...verdev.osuosl.org,
Wenliang Fan <fanwlexca@...il.com>,
linux-kernel@...r.kernel.org,
Rashika Kheria <rashika.kheria@...il.com>,
Tugce Sirin <ztugcesirin@...il.com>,
Aldo Iljazi <neonsync1@...il.com>
Subject: Re: [PATCH] staging: bcm: nvm.c: Cleaning up a array that is filled
incompletely
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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists