aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Huth <thuth@linux.vnet.ibm.com>2011-11-22 17:14:16 +0100
committerThomas Huth <thuth@linux.vnet.ibm.com>2011-11-24 10:59:47 +0100
commit4737144db1acbb1374616bafa4e569aac139c5aa (patch)
tree3270fef4f04c6559d13f76674cc8d83c966eb9a1
parent7345fac3e5d1828b0cdf8196fe8bd7afb109e1ab (diff)
downloadSLOF-4737144db1acbb1374616bafa4e569aac139c5aa.zip
SLOF-4737144db1acbb1374616bafa4e569aac139c5aa.tar.gz
SLOF-4737144db1acbb1374616bafa4e569aac139c5aa.tar.bz2
Check whether local-mac-address property exists before using its value
Fixed network booting for device tree nodes that do not provide a local-mac-address property by default. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
-rw-r--r--clients/net-snk/oflib/of.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/clients/net-snk/oflib/of.c b/clients/net-snk/oflib/of.c
index 31aa7f0..e74d2b0 100644
--- a/clients/net-snk/oflib/of.c
+++ b/clients/net-snk/oflib/of.c
@@ -793,11 +793,12 @@ get_mac(char *mac)
int len;
phandle_t net = get_boot_device();
-
if (net == -1)
return;
len = of_getprop(net, "local-mac-address", localmac, 8);
+ if (len <= 0)
+ return;
if (len == 8) {
/* Some bad FDT nodes like veth use a 8-byte wide