[U-Boot] [PATCH] remove useless free(ptr) calls on NULL ptr
Serge Ziryukin
ftrvxmtrx at gmail.com
Mon May 10 16:40:49 CEST 2010
Signed-off-by: Serge Ziryukin <ftrvxmtrx at gmail.com>
---
drivers/net/lan91c96.c | 1 -
drivers/net/smc911x.c | 1 -
2 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/drivers/net/lan91c96.c b/drivers/net/lan91c96.c
index 90e4002..810079f 100644
--- a/drivers/net/lan91c96.c
+++ b/drivers/net/lan91c96.c
@@ -795,7 +795,6 @@ int lan91c96_initialize(u8 dev_num, int base_addr)
dev = malloc(sizeof(*dev));
if (!dev) {
- free(dev);
return 0;
}
memset(dev, 0, sizeof(*dev));
diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c
index f2fc88b..3da4c35 100644
--- a/drivers/net/smc911x.c
+++ b/drivers/net/smc911x.c
@@ -242,7 +242,6 @@ int smc911x_initialize(u8 dev_num, int base_addr)
dev = malloc(sizeof(*dev));
if (!dev) {
- free(dev);
return -1;
}
memset(dev, 0, sizeof(*dev));
--
1.7.1
More information about the U-Boot
mailing list