mtd: phram: fix memory leak
authorMathias Krause <minipli@googlemail.com>
Sun, 30 Jan 2011 09:31:48 +0000 (10:31 +0100)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Fri, 11 Mar 2011 14:22:43 +0000 (14:22 +0000)
commitf17f12ce9dd6ec0a8e1f415ecdbaebfce0207464
tree99c01455d53f7184ac0a52fcfd208efbff9705a0
parent07be303d22ac7e067b8a7172a4043ebe32b74b33
mtd: phram: fix memory leak

Commit 4f678a58 (mtd: fix memory leaks in phram_setup) missed two cases
where the memory allocated for name would be leaked. This commit frees
the memory when register_device() fails and on unregister_devices().

Signed-off-by: Mathias Krause <minipli@googlemail.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/mtd/devices/phram.c