projects
/
platform
/
kernel
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3a15684
)
net: eepro100: Switch from malloc()+memset() to calloc()
author
Marek Vasut
<marek.vasut+renesas@gmail.com>
Sat, 23 May 2020 14:13:30 +0000
(16:13 +0200)
committer
Marek Vasut
<marek.vasut+renesas@gmail.com>
Thu, 18 Jun 2020 17:34:40 +0000
(19:34 +0200)
Replace malloc()+memset() combination with calloc(), no functional change.
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
drivers/net/eepro100.c
patch
|
blob
|
history
diff --git
a/drivers/net/eepro100.c
b/drivers/net/eepro100.c
index 74b09e9afd21800bfd1be3a400808d7f457c2e8c..8fa665743ae064a027501c8db1c6464acbf87359 100644
(file)
--- a/
drivers/net/eepro100.c
+++ b/
drivers/net/eepro100.c
@@
-746,12
+746,11
@@
int eepro100_initialize(bd_t *bis)
continue;
}
- dev =
(struct eth_device *)malloc(
sizeof(*dev));
+ dev =
calloc(1,
sizeof(*dev));
if (!dev) {
printf("eepro100: Can not allocate memory\n");
break;
}
- memset(dev, 0, sizeof(*dev));
sprintf(dev->name, "i82559#%d", card_number);
dev->priv = (void *)devno; /* this have to come before bus_to_phys() */