From: Jesper Juhl Date: Sat, 13 May 2006 23:07:18 +0000 (+0200) Subject: mtd: fix memory leaks in phram_setup X-Git-Tag: v2.6.18-rc1~1105^2~115 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f678a58d335291ce9213c049bbe16e6d24487ed;p=pandora-kernel.git mtd: fix memory leaks in phram_setup 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. Signed-off-by: Jesper Juhl Signed-off-by: David Woodhouse --- Reading git-diff-tree failed