Author: myles
Date: Thu Jun 10 06:06:52 2010
New Revision: 5628
URL: https://tracker.coreboot.org/trac/coreboot/changeset/5628

Log:
Check for NULL before calling device_match()

It matters for multifunction devices who don't have siblings.

The error in the rumba device tree created that situation.

Signed-off-by: Myles Watson <[email protected]>
Acked-by: Myles Watson <[email protected]>

Modified:
   trunk/util/sconfig/main.c

Modified: trunk/util/sconfig/main.c
==============================================================================
--- trunk/util/sconfig/main.c   Thu Jun 10 05:14:00 2010        (r5627)
+++ trunk/util/sconfig/main.c   Thu Jun 10 06:06:52 2010        (r5628)
@@ -348,7 +348,7 @@
                                        fprintf(fil, "\t\t\t.dev = &%s,\n", 
d->name);
                                        if (d->children)
                                                fprintf(fil, "\t\t\t.children = 
&%s,\n", d->children->name);
-                                       if (device_match(d->next_sibling, ptr))
+                                       if (d->next_sibling && 
device_match(d->next_sibling, ptr))
                                                fprintf(fil, 
"\t\t\t.next=&%s_links[%d],\n", d->name, d->link+1);
                                        else
                                                fprintf(fil, "\t\t\t.next = 
NULL,\n");

-- 
coreboot mailing list: [email protected]
http://www.coreboot.org/mailman/listinfo/coreboot

Reply via email to