diff mbox

[2/2] Check for NULL return of prom_get_netinfo()

Message ID 20080916002322.21352.53127.sendpatchset@chandra-ubuntu
State Rejected
Headers show

Commit Message

Chandra Seetharaman Sept. 16, 2008, 12:23 a.m. UTC
Check the return value of prom_get_netinfo() and return failure if
NULL.

Not returning here leads to a wierd failure.

Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com>
---
 second/yaboot.c |    2 ++
 1 file changed, 2 insertions(+)
diff mbox

Patch

Index: yaboot.git_head/second/yaboot.c
===================================================================
--- yaboot.git_head.orig/second/yaboot.c
+++ yaboot.git_head/second/yaboot.c
@@ -470,6 +470,8 @@  static int load_my_config_file(struct bo
      int minlen;
 
      packet = prom_get_netinfo();
+     if (!packet)
+	  return rc;
 
      /*
       * First, try to match on mac address with the hardware type