* [patch for 2.6.29? 4/4] mtd/maps: blackfin async flash maps: fix up memory leak
@ 2009-02-11 21:12 akpm
2009-02-12 0:35 ` Atsushi Nemoto
0 siblings, 1 reply; 7+ messages in thread
From: akpm @ 2009-02-11 21:12 UTC (permalink / raw)
To: dwmw2; +Cc: akpm, linux-mtd, cooloney, vapier.adi
From: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
drivers/mtd/maps/bfin-async-flash.c | 1 +
1 file changed, 1 insertion(+)
diff -puN drivers/mtd/maps/bfin-async-flash.c~mtd-maps-blackfin-async-flash-maps-fix-up-memory-leak drivers/mtd/maps/bfin-async-flash.c
--- a/drivers/mtd/maps/bfin-async-flash.c~mtd-maps-blackfin-async-flash-maps-fix-up-memory-leak
+++ a/drivers/mtd/maps/bfin-async-flash.c
@@ -170,6 +170,7 @@ static int __devinit bfin_flash_probe(st
if (ret > 0) {
pr_devinit(KERN_NOTICE DRIVER_NAME ": Using commandline partition definition\n");
add_mtd_partitions(state->mtd, pdata->parts, ret);
+ kfree(pdata->parts);
} else if (pdata->nr_parts) {
pr_devinit(KERN_NOTICE DRIVER_NAME ": Using board partition definition\n");
_
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [patch for 2.6.29? 4/4] mtd/maps: blackfin async flash maps: fix up memory leak 2009-02-11 21:12 [patch for 2.6.29? 4/4] mtd/maps: blackfin async flash maps: fix up memory leak akpm @ 2009-02-12 0:35 ` Atsushi Nemoto 2009-02-12 0:42 ` Andrew Morton 0 siblings, 1 reply; 7+ messages in thread From: Atsushi Nemoto @ 2009-02-12 0:35 UTC (permalink / raw) To: akpm; +Cc: linux-mtd, cooloney, dwmw2, vapier.adi On Wed, 11 Feb 2009 13:12:19 -0800, akpm@linux-foundation.org wrote: > @@ -170,6 +170,7 @@ static int __devinit bfin_flash_probe(st > if (ret > 0) { > pr_devinit(KERN_NOTICE DRIVER_NAME ": Using commandline partition definition\n"); > add_mtd_partitions(state->mtd, pdata->parts, ret); > + kfree(pdata->parts); > > } else if (pdata->nr_parts) { > pr_devinit(KERN_NOTICE DRIVER_NAME ": Using board partition definition\n"); As Matthias Kaehlcke pointed out in mail titled "[BUG] physmap_flash_probe() frees memory still in use", this fix introduce another bug. Revised patch for physmap driver is: http://lists.infradead.org/pipermail/linux-mtd/2009-February/024590.html Mike, please update this blackfin patch too. --- Atsushi Nemoto ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [patch for 2.6.29? 4/4] mtd/maps: blackfin async flash maps: fix up memory leak 2009-02-12 0:35 ` Atsushi Nemoto @ 2009-02-12 0:42 ` Andrew Morton 2009-02-14 8:57 ` David Woodhouse 0 siblings, 1 reply; 7+ messages in thread From: Andrew Morton @ 2009-02-12 0:42 UTC (permalink / raw) To: Atsushi Nemoto; +Cc: linux-mtd, cooloney, dwmw2, vapier.adi On Thu, 12 Feb 2009 09:35:31 +0900 (JST) Atsushi Nemoto <anemo@mba.ocn.ne.jp> wrote: > On Wed, 11 Feb 2009 13:12:19 -0800, akpm@linux-foundation.org wrote: > > @@ -170,6 +170,7 @@ static int __devinit bfin_flash_probe(st > > if (ret > 0) { > > pr_devinit(KERN_NOTICE DRIVER_NAME ": Using commandline partition definition\n"); > > add_mtd_partitions(state->mtd, pdata->parts, ret); > > + kfree(pdata->parts); > > > > } else if (pdata->nr_parts) { > > pr_devinit(KERN_NOTICE DRIVER_NAME ": Using board partition definition\n"); > > As Matthias Kaehlcke pointed out in mail titled "[BUG] > physmap_flash_probe() frees memory still in use", this fix introduce > another bug. > > 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.. ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [patch for 2.6.29? 4/4] mtd/maps: blackfin async flash maps: fix up memory leak 2009-02-12 0:42 ` Andrew Morton @ 2009-02-14 8:57 ` David Woodhouse 2009-02-17 20:02 ` Mike Frysinger 0 siblings, 1 reply; 7+ messages in thread From: David Woodhouse @ 2009-02-14 8:57 UTC (permalink / raw) To: Andrew Morton; +Cc: Atsushi Nemoto, linux-mtd, cooloney, vapier.adi 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. -- dwmw2 ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [patch for 2.6.29? 4/4] mtd/maps: blackfin async flash maps: fix up memory leak 2009-02-14 8:57 ` David Woodhouse @ 2009-02-17 20:02 ` Mike Frysinger 2009-02-19 0:37 ` Atsushi Nemoto 0 siblings, 1 reply; 7+ messages in thread From: Mike Frysinger @ 2009-02-17 20:02 UTC (permalink / raw) To: David Woodhouse; +Cc: Andrew Morton, linux-mtd, Atsushi Nemoto, cooloney [-- Attachment #1: Type: text/plain, Size: 653 bytes --] 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 [-- Attachment #2: bfin-async-flash-parts-leak.patch --] [-- Type: text/x-patch, Size: 610 bytes --] --- 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); ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [patch for 2.6.29? 4/4] mtd/maps: blackfin async flash maps: fix up memory leak 2009-02-17 20:02 ` Mike Frysinger @ 2009-02-19 0:37 ` Atsushi Nemoto 2009-02-19 1:19 ` Mike Frysinger 0 siblings, 1 reply; 7+ messages in thread From: Atsushi Nemoto @ 2009-02-19 0:37 UTC (permalink / raw) To: vapier.adi; +Cc: linux-mtd, akpm, dwmw2, cooloney 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 ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [patch for 2.6.29? 4/4] mtd/maps: blackfin async flash maps: fix up memory leak 2009-02-19 0:37 ` Atsushi Nemoto @ 2009-02-19 1:19 ` Mike Frysinger 0 siblings, 0 replies; 7+ messages in thread From: Mike Frysinger @ 2009-02-19 1:19 UTC (permalink / raw) To: Atsushi Nemoto; +Cc: linux-mtd, akpm, dwmw2, cooloney 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 ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2009-02-19 1:19 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2009-02-11 21:12 [patch for 2.6.29? 4/4] mtd/maps: blackfin async flash maps: fix up memory leak akpm 2009-02-12 0:35 ` Atsushi Nemoto 2009-02-12 0:42 ` Andrew Morton 2009-02-14 8:57 ` David Woodhouse 2009-02-17 20:02 ` Mike Frysinger 2009-02-19 0:37 ` Atsushi Nemoto 2009-02-19 1:19 ` Mike Frysinger
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox