[MTD] [NOR] Fix oops in cfi_amdstd_sync

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Thu Mar 8 05:59:02 EST 2007


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=83d480917b1af3f8fcffa7a9c8775e0f2dd03395
Commit:     83d480917b1af3f8fcffa7a9c8775e0f2dd03395
Parent:     dc164bbb4b5be9df4f249ab33576fa783c363b93
Author:     Vijay Sampath <vsampath at gmail.com>
AuthorDate: Tue Mar 6 02:39:44 2007 -0800
Committer:  David Woodhouse <dwmw2 at infradead.org>
CommitDate: Thu Mar 8 09:22:38 2007 +0000

    [MTD] [NOR] Fix oops in cfi_amdstd_sync
    
    The files cfi_cmdset_0002.c and cfi_cmdset_0020.c do not initialize their
    wait queues like is done in cfi_cmdset_0001.c.  This causes an oops when
    the wait queue is accessed.  I have copied the code from cfi_cmdset_0001.c
    that is pertinent to initialization of the wait queue.
    
    Signed-off-by: Vijay Sampath <vsampath at gmail.com>
    Acked-by: Joern Engel <joern at lazybastard.org>
    Acked-by: Josh Boyer <jwboyer at linux.vnet.ibm.com>
    Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
    Signed-off-by: David Woodhouse <dwmw2 at infradead.org>
---
 drivers/mtd/chips/cfi_cmdset_0002.c |    2 ++
 drivers/mtd/chips/cfi_cmdset_0020.c |    2 ++
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c
index e3acd39..1f64458 100644
--- a/drivers/mtd/chips/cfi_cmdset_0002.c
+++ b/drivers/mtd/chips/cfi_cmdset_0002.c
@@ -359,6 +359,8 @@ struct mtd_info *cfi_cmdset_0002(struct map_info *map, int primary)
 		cfi->chips[i].word_write_time = 1<<cfi->cfiq->WordWriteTimeoutTyp;
 		cfi->chips[i].buffer_write_time = 1<<cfi->cfiq->BufWriteTimeoutTyp;
 		cfi->chips[i].erase_time = 1<<cfi->cfiq->BlockEraseTimeoutTyp;
+		cfi->chips[i].ref_point_counter = 0;
+		init_waitqueue_head(&(cfi->chips[i].wq));
 	}
 
 	map->fldrv = &cfi_amdstd_chipdrv;
diff --git a/drivers/mtd/chips/cfi_cmdset_0020.c b/drivers/mtd/chips/cfi_cmdset_0020.c
index 69d49e0..b344ff8 100644
--- a/drivers/mtd/chips/cfi_cmdset_0020.c
+++ b/drivers/mtd/chips/cfi_cmdset_0020.c
@@ -158,6 +158,8 @@ struct mtd_info *cfi_cmdset_0020(struct map_info *map, int primary)
 		cfi->chips[i].word_write_time = 128;
 		cfi->chips[i].buffer_write_time = 128;
 		cfi->chips[i].erase_time = 1024;
+		cfi->chips[i].ref_point_counter = 0;
+		init_waitqueue_head(&(cfi->chips[i].wq));
 	}
 
 	return cfi_staa_setup(map);



More information about the linux-mtd-cvs mailing list