[PATCH] physmap: Fix leak of memory returned by parse_mtd_partitions
anemo at mba.ocn.ne.jp
Wed Nov 12 10:55:34 EST 2008
On Wed, 12 Nov 2008 23:57:33 +0900 (JST), Atsushi Nemoto <anemo at mba.ocn.ne.jp> wrote:
> The mtd partition parser returns an allocated pointer array of
> mtd_partition. The caller must free it. The array is used only for
> add_mtd_partitions(), so free it just after the call.
> Signed-off-by: Atsushi Nemoto <anemo at mba.ocn.ne.jp>
> drivers/mtd/maps/physmap.c | 17 ++++++++---------
> 1 files changed, 8 insertions(+), 9 deletions(-)
And many other callers of parse_mtd_partitions() also do not free the
returned memory. With a quick look, 21 of 36 have same defect.
More information about the linux-mtd