Re: [PATCH] mtd: fix memory leaks in phram_setup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 2006-05-14 at 01:07 +0200, Jesper Juhl wrote:
> There are two code paths in drivers/mtd/devices/phram.c::phram_setup() that
> will leak memory.
> Memory is allocated to the variable 'name' with kmalloc() by the 
> parse_name() function, but if we leave by way of the parse_err() macro, 
> then that memory is never kfree()'d, nor is it ever used with 
> register_device() so it won't be freed later either - leak.
> 
> Found by the Coverity checker as #593 - simple fix below.

Applied; thanks. Please Cc me and/or [email protected] on
MTD patches.

(Ew. The parse_err() macro contains a 'return'. Who do I slap for that?)

-- 
dwmw2

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux