Commit 4da0ea71 authored by Dan Carpenter's avatar Dan Carpenter Committed by Miquel Raynal
Browse files

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: 8dc00439 ("[MTD] LPDDR qinfo probing.")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200228092554.o57igp3nqhyvf66t@kili.mountain
parent c0b66dce
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -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;
	}