mtd/drivers/mtd/chips jedec.c,1.13,1.14

David Woodhouse dwmw2 at infradead.org
Wed Jun 26 22:19:15 EDT 2002


Update of /home/cvs/mtd/drivers/mtd/chips
In directory phoenix.infradead.org:/tmp/cvs-serv28626

Modified Files:
	jedec.c 
Log Message:
Hello David,

This patch fixes a bug in drivers/mtd/chips/jedec.c.

In the code below, Size is in 4-byte units while map->size is in
1-byte units.  The symptom that I see is that unless I set map->size
to be greater than the actual size of the flash area, I get an oops
while accessing one byte beyond the flash.

Thanks,
-Dale Farnsworth


Index: jedec.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/chips/jedec.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- jedec.c	8 Feb 2002 15:57:21 -0000	1.13
+++ jedec.c	27 Jun 2002 02:19:12 -0000	1.14
@@ -465,8 +465,8 @@
       we call this routine with the JEDEC return still enabled, if two or
       more flashes have a truncated address space the probe test will still
       work */
-   if (base + Size+0x555 < map->size &&
-       base + Size+0x555 < (base & (~(my_bank_size-1))) + my_bank_size)
+   if (base + (Size<<2)+0x555 < map->size &&
+       base + (Size<<2)+0x555 < (base & (~(my_bank_size-1))) + my_bank_size)
    {
       if (flread(base+Size) != flread(base+Size + 0x100) ||
 	  flread(base+Size + 1) != flread(base+Size + 0x101))





More information about the linux-mtd-cvs mailing list