net: eth: Check return value in various places
authorBin Meng <bmeng.cn@gmail.com>
Thu, 8 Oct 2015 04:45:44 +0000 (21:45 -0700)
committerJoe Hershberger <joe.hershberger@ni.com>
Thu, 29 Oct 2015 19:05:52 +0000 (14:05 -0500)
commitac1d31380618f3f68bf7f05b73b6ab0cdeab0e9f
tree727411073a7ad684eaaa844ee492b9dec4a176af
parent6d9764c2a87cc5a1ce4f3919add6360ec36f81c7
net: eth: Check return value in various places

eth_get_dev() can return NULL which means device_probe() fails for
that ethernet device. Add return value check in various places or
U-Boot will crash due to NULL pointer access.

With this commit, 'dm_test_eth_act' test case passes.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
net/eth.c