summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorNobuhiro Iwamatsu <iwamatsu@nigauri.org>2010-10-19 14:03:43 +0900
committerWolfgang Denk <wd@denx.de>2010-11-14 23:17:43 +0100
commita9bc6d7ccfb8c1f72df1473faad9559888d3812e (patch)
treee26659e0f1c8d7d921305713d485213ad7e86adc /drivers/net
parentde0b95762a048a6815cd019b3a0e1acf0dbd70f4 (diff)
downloadu-boot-imx-a9bc6d7ccfb8c1f72df1473faad9559888d3812e.zip
u-boot-imx-a9bc6d7ccfb8c1f72df1473faad9559888d3812e.tar.gz
u-boot-imx-a9bc6d7ccfb8c1f72df1473faad9559888d3812e.tar.bz2
net: natsemi: Add initialized eth_device structure
natsemi driver does not have write_hwaddr function. However, eth stuff executes write_hwaddr function because eth_device structure has not been initialized. Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org> CC: Ben Warren <biggerbadderben@gmail.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/natsemi.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/natsemi.c b/drivers/net/natsemi.c
index e09da1d..14b2d35 100644
--- a/drivers/net/natsemi.c
+++ b/drivers/net/natsemi.c
@@ -321,6 +321,11 @@ natsemi_initialize(bd_t * bis)
}
dev = (struct eth_device *) malloc(sizeof *dev);
+ if (!dev) {
+ printf("natsemi: Can not allocate memory\n");
+ break;
+ }
+ memset(dev, 0, sizeof(*dev));
sprintf(dev->name, "dp83815#%d", card_number);
dev->iobase = bus_to_phys(iobase);