Hi List,

during coreboot development i faced the problem that coreboot sometimes
hanged after printing the List of PCI devices. It turned out that this
is a NULL pointer dereference in search_bus_devices().

Not sure if the following patch is the correct fix, as i don't know
that part of the code well. If it is not, please discard the patch
and provide a better one :)

commit 11a840272dd5f0d0f1a8414163f5404fb028c209
Author: Sven Schnelle <sv...@stackframe.org>
Date:   Mon Jan 10 13:53:18 2011 +0100

    Fix a NULL pointer dereference in search_bus_devices()
    
    Signed-off-by: Sven Schnelle <sv...@stackframe.org>

diff --git a/src/devices/device_util.c b/src/devices/device_util.c
index 9081a36..d761cba 100644
--- a/src/devices/device_util.c
+++ b/src/devices/device_util.c
@@ -583,8 +583,9 @@ void search_bus_resources(struct bus *bus, unsigned long 
type_mask,
                                        if (subbus->link_num
                                        == IOINDEX_SUBTRACTIVE_LINK(res->index))
                                                break;
-                               search_bus_resources(subbus, type_mask, type,
-                                                    search, gp);
+                               if (subbus)
+                                       search_bus_resources(subbus, type_mask, 
type,
+                                                               search, gp);
                                continue;
                        }
                        search(gp, curdev, res);

Attachment: pgp0qyoHSsG68.pgp
Description: PGP signature

-- 
coreboot mailing list: coreboot@coreboot.org
http://www.coreboot.org/mailman/listinfo/coreboot

Reply via email to