Bug in mtd_speedtest?

David Lambert dave at lambsys.com
Fri Mar 4 12:53:18 EST 2011


Artem,
     Please find attached patch.

Regards,

Dave.

On 03/04/2011 12:59 AM, Artem Bityutskiy wrote:
> On Thu, 2011-03-03 at 17:45 -0600, David Lambert wrote:
>> I think I may have found an overflow condition in the speed calculation
>> of mtd_speedtest on some platforms with larger flash partitions:
>>
>> Consider for example if goodebcnt = 15000, and mtd->erasesize =
>> 256*1024, then there is an intermediate product of  3932160000 which
>> results in the sign bit being set on a 32 bit integer. Maybe k should be
>> an unsigned long long?
> Please, just send a patch :-)
>

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch
URL: <http://lists.infradead.org/pipermail/linux-mtd/attachments/20110304/2a17bd04/attachment.ksh>


More information about the linux-mtd mailing list