aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/chips/sharp.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/chips/sharp.c')
-rw-r--r--drivers/mtd/chips/sharp.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/mtd/chips/sharp.c b/drivers/mtd/chips/sharp.c
index 967abbecdff9..c9cd3d21ccfa 100644
--- a/drivers/mtd/chips/sharp.c
+++ b/drivers/mtd/chips/sharp.c
@@ -112,18 +112,16 @@ static struct mtd_info *sharp_probe(struct map_info *map)
112 struct sharp_info *sharp = NULL; 112 struct sharp_info *sharp = NULL;
113 int width; 113 int width;
114 114
115 mtd = kmalloc(sizeof(*mtd), GFP_KERNEL); 115 mtd = kzalloc(sizeof(*mtd), GFP_KERNEL);
116 if(!mtd) 116 if(!mtd)
117 return NULL; 117 return NULL;
118 118
119 sharp = kmalloc(sizeof(*sharp), GFP_KERNEL); 119 sharp = kzalloc(sizeof(*sharp), GFP_KERNEL);
120 if(!sharp) { 120 if(!sharp) {
121 kfree(mtd); 121 kfree(mtd);
122 return NULL; 122 return NULL;
123 } 123 }
124 124
125 memset(mtd, 0, sizeof(*mtd));
126
127 width = sharp_probe_map(map,mtd); 125 width = sharp_probe_map(map,mtd);
128 if(!width){ 126 if(!width){
129 kfree(mtd); 127 kfree(mtd);
@@ -143,7 +141,6 @@ static struct mtd_info *sharp_probe(struct map_info *map)
143 mtd->writesize = 1; 141 mtd->writesize = 1;
144 mtd->name = map->name; 142 mtd->name = map->name;
145 143
146 memset(sharp, 0, sizeof(*sharp));
147 sharp->chipshift = 23; 144 sharp->chipshift = 23;
148 sharp->numchips = 1; 145 sharp->numchips = 1;
149 sharp->chips[0].start = 0; 146 sharp->chips[0].start = 0;