From: Matthias Kaehlcke Date: Thu, 21 Jan 2010 21:16:34 +0000 (+0100) Subject: cs8900_initialize() cleanup X-Git-Tag: v2010.03-rc1~95^2~12 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=07c966066b977b24f4b08b1684eed130f463b4c6;p=u-boot cs8900_initialize() cleanup cs8900_initialize(): remove unecessary calls to free() and fix memory leak Signed-off-by: Matthias Kaehlcke Signed-off-by: Ben Warren --- diff --git a/drivers/net/cs8900.c b/drivers/net/cs8900.c index df360042be..9424fb2bb6 100644 --- a/drivers/net/cs8900.c +++ b/drivers/net/cs8900.c @@ -308,14 +308,13 @@ int cs8900_initialize(u8 dev_num, int base_addr) dev = malloc(sizeof(*dev)); if (!dev) { - free(dev); return 0; } memset(dev, 0, sizeof(*dev)); priv = malloc(sizeof(*priv)); if (!priv) { - free(priv); + free(dev); return 0; } memset(priv, 0, sizeof(*priv));