summaryrefslogtreecommitdiff
path: root/src/northbridge
diff options
context:
space:
mode:
Diffstat (limited to 'src/northbridge')
-rw-r--r--src/northbridge/amd/pi/00730F01/northbridge.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/northbridge/amd/pi/00730F01/northbridge.c b/src/northbridge/amd/pi/00730F01/northbridge.c
index a4409fb0df..5e82ccd51c 100644
--- a/src/northbridge/amd/pi/00730F01/northbridge.c
+++ b/src/northbridge/amd/pi/00730F01/northbridge.c
@@ -235,7 +235,6 @@ static void add_ivhd_device_entries(struct device *parent, struct device *dev,
unsigned long *current, uint16_t *ivhd_length)
{
struct device *sibling;
- struct bus *link;
if (!root_level) {
root_level = malloc(sizeof(int8_t));
@@ -254,11 +253,11 @@ static void add_ivhd_device_entries(struct device *parent, struct device *dev,
}
}
- for (link = dev->link_list; link; link = link->next)
- for (sibling = link->children; sibling; sibling =
- sibling->sibling)
+ if (dev->link_list) {
+ for (sibling = dev->link_list->children; sibling; sibling = sibling->sibling)
add_ivhd_device_entries(dev, sibling, depth + 1, depth, root_level,
current, ivhd_length);
+ }
free(root_level);
}