From 07c966066b977b24f4b08b1684eed130f463b4c6 Mon Sep 17 00:00:00 2001 From: Matthias Kaehlcke Date: Thu, 21 Jan 2010 22:16:34 +0100 Subject: [PATCH] cs8900_initialize() cleanup cs8900_initialize(): remove unecessary calls to free() and fix memory leak Signed-off-by: Matthias Kaehlcke Signed-off-by: Ben Warren --- drivers/net/cs8900.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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)); -- 2.30.2