NET: Fix system hanging if NET device is not installed
authorJim Lin <jilin@nvidia.com>
Fri, 17 May 2013 09:41:03 +0000 (17:41 +0800)
committerJae-young Hwang <j-zero.hwang@samsung.com>
Mon, 18 Jan 2016 12:46:07 +0000 (21:46 +0900)
commitf4d884a8ead99046f7b8b2b54e441c9c07f76169
treee37f93ebdf2d9ba7ed2915e0d540e7508a322578
parent66b069f5a0f99d6c59793f5d8d2a7fcac190c525
NET: Fix system hanging if NET device is not installed

If we try to boot from NET device, NetInitLoop in net.c will be invoked.
If NET device is not installed, eth_get_dev() function will return
eth_current value, which is NULL.
When NetInitLoop is called, "eth_get_dev->enetaddr" will access
restricted memory area and therefore cause hanging.
This issue is found on Tegra30 Cardhu platform after adding
CONFIG_CMD_NET and CONFIG_CMD_DHCP in config header file.

Change-Id: I8bf18901842043f33a06c96ab5201c406fe0f605
Signed-off-by: Jim Lin <jilin@nvidia.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Jae-young Hwang <j-zero.hwang@samsung.com>
net/net.c