Usage of MTD_UADDR_UNNECESSARY broken?

Alexander Hoffmann ahoffmann at sysgo.de
Mon Nov 8 07:55:03 EST 2004


Ben Dooks wrote:

>On Mon, Nov 08, 2004 at 12:54:16PM +0100, Alexander Hoffmann wrote:
>  
>
>>Hi everyone,
>>
>>can anybody please explain me the exact difference between 
>>MTD_UADDR_DONT_CARE and MTD_UADDR_UNNECESSARY .
>>Because if I use MTD_UADDR_UNNECESSARY an not existing field in the 
>>unlock_addrs array is beeing referenced
>>(/drivers/mtd/chips/jedec_probe.c, function cfi_jedec_setup, line 1740):
>>
>>/* Mask out address bits which are smaller than the device type */
>>mask = ~(p_cfi->device_type-1);
>>p_cfi->addr_unlock1 = unlock_addrs[uaddr].addr1 & mask;
>>p_cfi->addr_unlock2 = unlock_addrs[uaddr].addr2 & mask;
>>    
>>
>
>hmm, thought this masking had been eliminated in later copies of
>the mtd code?
>
>  
>
Ok, you are right. But this doesn't change the fact that

unlock_addrs[uaddr].addr1

refers to an nonexisting field in the unlock_addrs array.

Alex.





More information about the linux-mtd mailing list