Fix kfree usage in various mtd map remove functions (2nd go)
PATCH 1/1 Fix kfree usage in various mtd map remove functions (2nd go)
The remove() functions in various mtd map drivers were failing to free the *_flash_info structure.
Since mtd drivers are rarely or never used as modules (they typically provide root filesystems) it is unlikely that these code paths have ever been exercised. It also means that this patch has not been tested by the author.
This patch is against 2.6.21, and supersedes the version that I posted on 2007-05-17; that version made an additional incorrect change to the usage of release_resource().
Signed-off-by Phil Endecott <spam_from_linux_mtd_patch <at> chezphil.org>
mtd/maps/ixp2000.c renamed from mtd/maps.orig/ixp2000.c +2 -0
@@ -134,6 +134,8 @@kfree (info->res); } +kfree (info); +if (plat->exit) plat->exit ();
mtd/maps/ixp4xx.c renamed from mtd/maps.orig/ixp4xx.c +2 -0
@@ -177,6 +177,8 @@kfree (info->res); } +kfree (info); +if (plat->exit) plat->exit ();
mtd/maps/physmap.c renamed from mtd/maps.orig/physmap.c +2 -0
@@ -69,6 +69,8 @@kfree (info->res); } +kfree (info); +return 0 ; }
mtd/maps/physmap_of.c renamed from mtd/maps.orig/physmap_of.c +2 -0
@@ -112,6 +112,8 @@kfree (info->res); } +kfree (info); +return 0 ; }