The CMOS 'option_table' isn't populated on ARM devices running coreboot.
Check to see if the pointer is NULL and bail out if it is.

Signed-off-by: Stephen Boyd <swb...@chromium.org>
---
 cmd/x86/cbsysinfo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cmd/x86/cbsysinfo.c b/cmd/x86/cbsysinfo.c
index 3936d30da0e1..ed7b50f6d0fc 100644
--- a/cmd/x86/cbsysinfo.c
+++ b/cmd/x86/cbsysinfo.c
@@ -224,7 +224,7 @@ static void show_option_table(const struct 
cb_cmos_option_table *tab)
        const void *ptr, *end;
 
        print_ptr("option_table", tab);
-       if (!tab->size)
+       if (!tab || !tab->size)
                return;
 
        printf(" Bit  Len  Cfg  ID  Name\n");
-- 
Sent by a computer, using git, on the internet

Reply via email to