aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/lpddr
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/lpddr')
-rw-r--r--drivers/mtd/lpddr/qinfo_probe.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/mtd/lpddr/qinfo_probe.c b/drivers/mtd/lpddr/qinfo_probe.c
index 79bf40f48b75..dbfe17baf046 100644
--- a/drivers/mtd/lpddr/qinfo_probe.c
+++ b/drivers/mtd/lpddr/qinfo_probe.c
@@ -134,13 +134,12 @@ out:
134static int lpddr_chip_setup(struct map_info *map, struct lpddr_private *lpddr) 134static int lpddr_chip_setup(struct map_info *map, struct lpddr_private *lpddr)
135{ 135{
136 136
137 lpddr->qinfo = kmalloc(sizeof(struct qinfo_chip), GFP_KERNEL); 137 lpddr->qinfo = kzalloc(sizeof(struct qinfo_chip), GFP_KERNEL);
138 if (!lpddr->qinfo) { 138 if (!lpddr->qinfo) {
139 printk(KERN_WARNING "%s: no memory for LPDDR qinfo structure\n", 139 printk(KERN_WARNING "%s: no memory for LPDDR qinfo structure\n",
140 map->name); 140 map->name);
141 return 0; 141 return 0;
142 } 142 }
143 memset(lpddr->qinfo, 0, sizeof(struct qinfo_chip));
144 143
145 /* Get the ManuID */ 144 /* Get the ManuID */
146 lpddr->ManufactId = CMDVAL(map_read(map, map->pfow_base + PFOW_MANUFACTURER_ID)); 145 lpddr->ManufactId = CMDVAL(map_read(map, map->pfow_base + PFOW_MANUFACTURER_ID));
@@ -185,13 +184,11 @@ static struct lpddr_private *lpddr_probe_chip(struct map_info *map)
185 lpddr.numchips = 1; 184 lpddr.numchips = 1;
186 185
187 numvirtchips = lpddr.numchips * lpddr.qinfo->HWPartsNum; 186 numvirtchips = lpddr.numchips * lpddr.qinfo->HWPartsNum;
188 retlpddr = kmalloc(sizeof(struct lpddr_private) + 187 retlpddr = kzalloc(sizeof(struct lpddr_private) +
189 numvirtchips * sizeof(struct flchip), GFP_KERNEL); 188 numvirtchips * sizeof(struct flchip), GFP_KERNEL);
190 if (!retlpddr) 189 if (!retlpddr)
191 return NULL; 190 return NULL;
192 191
193 memset(retlpddr, 0, sizeof(struct lpddr_private) +
194 numvirtchips * sizeof(struct flchip));
195 memcpy(retlpddr, &lpddr, sizeof(struct lpddr_private)); 192 memcpy(retlpddr, &lpddr, sizeof(struct lpddr_private));
196 193
197 retlpddr->numchips = numvirtchips; 194 retlpddr->numchips = numvirtchips;