drivers/mtd/lpddr/lpddr_cmds.c: eliminate double free
Subsystems (2)
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.
Signed-off-by Julia Lawall <[email protected]>
--- drivers/mtd/lpddr/lpddr_cmds.c | 1 - 1 file changed, 1 deletion(-)
drivers/mtd/lpddr/lpddr_cmds.c +0 -1
@@ -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 ; }