Patchwork [for,2.6.29?,4/4] mtd/maps: blackfin async flash maps: fix up memory leak

login
register
mail settings
Submitter Mike Frysinger
Date Feb. 17, 2009, 8:02 p.m.
Message ID <8bd0f97a0902171202i449ede68k3dd726039b4c2f4a@mail.gmail.com>
Download mbox | patch
Permalink /patch/23329/
State New, archived
Headers show

Comments

Mike Frysinger - Feb. 17, 2009, 8:02 p.m.
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
Atsushi Nemoto - Feb. 19, 2009, 12:37 a.m.
On Tue, 17 Feb 2009 15:02:11 -0500, Mike Frysinger <vapier.adi@gmail.com> wrote:
> i'm not entirely sure what the change is by reading that patch.  what
> i've got is attached.

Looks fine for me.  Thanks.
---
Atsushi Nemoto
Mike Frysinger - Feb. 19, 2009, 1:19 a.m.
On Wed, Feb 18, 2009 at 19:37, Atsushi Nemoto wrote:
> On Tue, 17 Feb 2009 15:02:11 -0500, Mike Frysinger wrote:
>> i'm not entirely sure what the change is by reading that patch.  what
>> i've got is attached.
>
> Looks fine for me.  Thanks.

ok, i'll wait for my other patches against bfin-async-flash to make it
into mainline and i'll post a follow up patch for this.
-mike

Patch

--- 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);