From: Nobuhiro Iwamatsu Date: Tue, 19 Oct 2010 05:03:43 +0000 (+0900) Subject: net: natsemi: Add initialized eth_device structure X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=a9bc6d7ccfb8c1f72df1473faad9559888d3812e;p=project%2Fbcm63xx%2Fu-boot.git 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 CC: Ben Warren --- diff --git a/drivers/net/natsemi.c b/drivers/net/natsemi.c index e09da1d2ae..14b2d355c1 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);