From 8b98f8bf076dbbd5bf5431ec41c06c3942880a24 Mon Sep 17 00:00:00 2001 From: Angel Pons Date: Tue, 7 Sep 2021 14:00:17 +0200 Subject: SMBIOS: Skip `get_smbios_data` for disabled devices If a device is disabled, do not call the `get_smbios_data` code. Change-Id: I8960f869e0864f7c82d5fe507f96b62cbd045569 Signed-off-by: Angel Pons Reviewed-on: https://review.coreboot.org/c/coreboot/+/57458 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber Reviewed-by: Tim Wawrzynczak Reviewed-by: Felix Held --- src/arch/x86/smbios.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/arch/x86') diff --git a/src/arch/x86/smbios.c b/src/arch/x86/smbios.c index 967883a61e..e9c8f47a44 100644 --- a/src/arch/x86/smbios.c +++ b/src/arch/x86/smbios.c @@ -1229,7 +1229,10 @@ static int smbios_walk_device_tree(struct device *tree, int *handle, unsigned lo int len = 0; for (dev = tree; dev; dev = dev->next) { - if (dev->enabled && dev->ops && dev->ops->get_smbios_data) { + if (!dev->enabled) + continue; + + if (dev->ops && dev->ops->get_smbios_data) { printk(BIOS_INFO, "%s (%s)\n", dev_path(dev), dev_name(dev)); len += dev->ops->get_smbios_data(dev, handle, current); } else { -- cgit v1.2.3