smc911x_initialize(): remove unecessary call to free() and
return 0 in case of failure instead of -1

Signed-off-by: Matthias Kaehlcke <matth...@kaehlcke.net>
---
 drivers/net/smc911x.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c
index 5d51406..f2b5895 100644
--- a/drivers/net/smc911x.c
+++ b/drivers/net/smc911x.c
@@ -242,8 +242,7 @@ int smc911x_initialize(u8 dev_num, int base_addr)
 
        dev = malloc(sizeof(*dev));
        if (!dev) {
-               free(dev);
-               return -1;
+               return 0;
        }
        memset(dev, 0, sizeof(*dev));
 
-- 
1.6.3.1

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to