From 6f5225c7e0ad7a373af1decc212cde5c33b00730 Mon Sep 17 00:00:00 2001 From: Thejaswani Putta Date: Thu, 11 Apr 2019 18:36:08 -0700 Subject: Klocwork: Fix the Null pointer derefernce found by klocwork Signed-off-by: Thejaswani Putta Change-Id: I15973ac28e9645826986cf63d2160eedb83024e4 Reviewed-on: https://review.coreboot.org/c/coreboot/+/32290 Reviewed-by: Julius Werner Reviewed-by: Lijian Zhao Tested-by: build bot (Jenkins) --- src/soc/intel/broadwell/ramstage.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/soc/intel/broadwell') diff --git a/src/soc/intel/broadwell/ramstage.c b/src/soc/intel/broadwell/ramstage.c index e1883f2ecd..706536940d 100644 --- a/src/soc/intel/broadwell/ramstage.c +++ b/src/soc/intel/broadwell/ramstage.c @@ -23,6 +23,7 @@ #include #include #include +#include /* Save wake source information for calculating ACPI _SWS values */ int soc_fill_acpi_wake(uint32_t *pm1, uint32_t **gpe0) @@ -31,6 +32,8 @@ int soc_fill_acpi_wake(uint32_t *pm1, uint32_t **gpe0) static uint32_t gpe0_sts[GPE0_REG_MAX]; int i; + assert(ps != NULL); + *pm1 = ps->pm1_sts & ps->pm1_en; /* Mask off GPE0 status bits that are not enabled */ -- cgit v1.2.3