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

login
register
mail settings
Submitter Chandra Seetharaman
Date Sept. 16, 2008, 12:23 a.m.
Message ID <20080916002322.21352.53127.sendpatchset@chandra-ubuntu>
Download mbox | patch
Permalink /patch/22971/
State Rejected
Headers show

Comments

Chandra Seetharaman - Sept. 16, 2008, 12:23 a.m.
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(+)

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