Skip to contentSkip to conversation

drivers/mtd/lpddr/lpddr_cmds.c: eliminate double free

PATCH New Julia Lawall 1 participant 1 message Jul 4, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers/mtd/lpddr/lpddr_cmds.c: eliminate double free

From: Julia Lawall <[email protected]>

The only call to lpddr_cmdset is in the function defined in lpddr_probe drivers/mtd/lpddr/qinfo_probe.c. If the result of calling lpddr_cmdset is NULL, this function frees lpddr. So lpddr should not be freed in lpddr_cmdset.

---
 drivers/mtd/lpddr/lpddr_cmds.c |    1 -
 1 file changed, 1 deletion(-)
drivers/mtd/lpddr/lpddr_cmds.c +0 -1
index 65655dd..b7f265e 100644
@@ -89,7 +89,6 @@ struct mtd_info *lpddr_cmdset(struct map_info *map)
 	shared = kmalloc(sizeof(struct flchip_shared) * lpddr->numchips,
 						GFP_KERNEL);
 	if (!shared) {
-		kfree(lpddr);
 		kfree(mtd);
 		return NULL;
 	}