mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drivers/mtd/lpddr/lpddr_cmds.c: eliminate double free
@ 2011-07-04 14:20 Julia Lawall
  0 siblings, 0 replies; only message in thread
From: Julia Lawall @ 2011-07-04 14:20 UTC (permalink / raw)
  To: David Woodhouse
  Cc: kernel-janitors, Joakim Tjernlund, Tadashi Abe, Lucas De Marchi,
	Stefani Seibold, linux-mtd, linux-kernel

From: Julia Lawall <julia@diku.dk>

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 <julia@diku.dk>

---
 drivers/mtd/lpddr/lpddr_cmds.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/mtd/lpddr/lpddr_cmds.c b/drivers/mtd/lpddr/lpddr_cmds.c
index 65655dd..b7f265e 100644
--- a/drivers/mtd/lpddr/lpddr_cmds.c
+++ b/drivers/mtd/lpddr/lpddr_cmds.c
@@ -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;
 	}


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-07-04 14:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-04 14:20 [PATCH] drivers/mtd/lpddr/lpddr_cmds.c: eliminate double free Julia Lawall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®