From 8dd4a750815b2a52a40b8439ec17a854f04fb649 Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Wed, 11 May 2011 15:57:07 -0700 Subject: [PATCH] Don't try to compute I/O for empty sub buses. I am not sure if the sub bus being 0 is a problem, or if the assumption there has to be at least one non empty link is just wrong. It certainly does not hurt to add a small consistency check in either case. Change-Id: I098446deef96a8baae26a7ca1ddd96e626a06dc5 Signed-off-by: Stefan Reinauer --- src/devices/device_util.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/devices/device_util.c b/src/devices/device_util.c index 9081a36ea2..47cf98824f 100644 --- a/src/devices/device_util.c +++ b/src/devices/device_util.c @@ -583,6 +583,8 @@ void search_bus_resources(struct bus *bus, unsigned long type_mask, if (subbus->link_num == IOINDEX_SUBTRACTIVE_LINK(res->index)) break; + if (!subbus) /* Why can subbus be NULL? */ + break; search_bus_resources(subbus, type_mask, type, search, gp); continue;