projects
/
platform
/
kernel
/
u-boot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
net: smc911x: Replace malloc()+memset() with calloc()
[platform/kernel/u-boot.git]
/
drivers
/
net
/
smc911x.c
diff --git
a/drivers/net/smc911x.c
b/drivers/net/smc911x.c
index
24b4eae
..
2c72e34
100644
(file)
--- a/
drivers/net/smc911x.c
+++ b/
drivers/net/smc911x.c
@@
-242,11
+242,9
@@
int smc911x_initialize(u8 dev_num, int base_addr)
unsigned long addrl, addrh;
struct eth_device *dev;
- dev = malloc(sizeof(*dev));
- if (!dev) {
- return -1;
- }
- memset(dev, 0, sizeof(*dev));
+ dev = calloc(1, sizeof(*dev));
+ if (!dev)
+ return -ENOMEM;
dev->iobase = base_addr;