From patchwork Tue Feb 17 20:02:11 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [for, 2.6.29?, 4/4] mtd/maps: blackfin async flash maps: fix up memory leak Date: Tue, 17 Feb 2009 10:02:11 -0000 From: Mike Frysinger X-Patchwork-Id: 23329 Message-Id: <8bd0f97a0902171202i449ede68k3dd726039b4c2f4a@mail.gmail.com> To: David Woodhouse Cc: Andrew Morton , linux-mtd@lists.infradead.org, Atsushi Nemoto , cooloney@kernel.org On Sat, Feb 14, 2009 at 03:57, David Woodhouse wrote: > On Wed, 2009-02-11 at 16:42 -0800, Andrew Morton wrote: >> > Revised patch for physmap driver is: >> > >> http://lists.infradead.org/pipermail/linux-mtd/2009-February/024590.html >> > >> > Mike, please update this blackfin patch too. >> > >> >> I don't have a copy of that patch. You're on you own, guys.. > > Er, wasn't your [1/4] actually Nemoto-san's latest physmap patch? > > Mike, please can I have an updated version of the blackfin patch? > > Nemoto-san, thank you for taking care of this. i'm not entirely sure what the change is by reading that patch. what i've got is attached. -mike --- a/drivers/mtd/maps/bfin-async-flash.c +++ b/drivers/mtd/maps/bfin-async-flash.c @@ -41,4 +41,7 @@ uint32_t save_ambctl0, save_ambctl1; unsigned long irq_flags; +#ifdef CONFIG_MTD_PARTITIONS + struct mtd_partition *parts; +#endif }; @@ -167,4 +174,5 @@ pr_devinit(KERN_NOTICE DRIVER_NAME ": Using commandline partition definition\n"); add_mtd_partitions(state->mtd, pdata->parts, ret); + state->parts = pdata->parts; } else if (pdata->nr_parts) { @@ -190,4 +198,5 @@ #ifdef CONFIG_MTD_PARTITIONS del_mtd_partitions(state->mtd); + kfree(state->parts); #endif map_destroy(state->mtd);