summaryrefslogtreecommitdiff
path: root/drivers/mtd/lpddr
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2020-02-28 12:25:54 +0300
committerMiquel Raynal <miquel.raynal@bootlin.com>2020-03-11 14:49:30 +0100
commit4da0ea71ea934af18db4c63396ba2af1a679ef02 (patch)
tree8a186d9293e335cd6f25240e30a46d96e37aa0c2 /drivers/mtd/lpddr
parentc0b66dce0ca8e628c73f673f368230a455ea6631 (diff)
mtd: lpddr: Fix a double free in probe()
This function is only called from lpddr_probe(). We free "lpddr" both here and in the caller, so it's a double free. The best place to free "lpddr" is in lpddr_probe() so let's delete this one. Fixes: 8dc004395d5e ("[MTD] LPDDR qinfo probing.") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20200228092554.o57igp3nqhyvf66t@kili.mountain
Diffstat (limited to 'drivers/mtd/lpddr')
-rw-r--r--drivers/mtd/lpddr/lpddr_cmds.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/drivers/mtd/lpddr/lpddr_cmds.c b/drivers/mtd/lpddr/lpddr_cmds.c
index 1efc643c9871..9341a8a592e8 100644
--- a/drivers/mtd/lpddr/lpddr_cmds.c
+++ b/drivers/mtd/lpddr/lpddr_cmds.c
@@ -68,7 +68,6 @@ struct mtd_info *lpddr_cmdset(struct map_info *map)
shared = kmalloc_array(lpddr->numchips, sizeof(struct flchip_shared),
GFP_KERNEL);
if (!shared) {
- kfree(lpddr);
kfree(mtd);
return NULL;
}