From 840bef061fca0ee40619e43e75ab073e9dab2d0a Mon Sep 17 00:00:00 2001 From: Karthikeyan Ramasubramanian Date: Mon, 9 Mar 2020 11:02:26 -0600 Subject: soc/intel/tigerlake: Fix stale device pointer usage TEST=Build the mainboard. Signed-off-by: Karthikeyan Ramasubramanian Change-Id: I43cccd32589d75a9b0c7e60f8c82b19bbe6b69a7 Reviewed-on: https://review.coreboot.org/c/coreboot/+/39405 Tested-by: build bot (Jenkins) Reviewed-by: Caveh Jalali Reviewed-by: Furquan Shaikh Reviewed-by: Nick Vaccaro Reviewed-by: Aamir Bohra --- src/soc/intel/tigerlake/fsp_params_jsl.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/soc') diff --git a/src/soc/intel/tigerlake/fsp_params_jsl.c b/src/soc/intel/tigerlake/fsp_params_jsl.c index 6cb3b6718d..96aa7ba016 100644 --- a/src/soc/intel/tigerlake/fsp_params_jsl.c +++ b/src/soc/intel/tigerlake/fsp_params_jsl.c @@ -143,7 +143,11 @@ void platform_fsp_silicon_init_params_cb(FSPS_UPD *supd) } /* SDCard related configuration */ - params->ScsSdCardEnabled = pcidev_path_on_root(PCH_DEVFN_SDCARD) ? dev->enabled : 0; + dev = pcidev_path_on_root(PCH_DEVFN_SDCARD); + if (!dev) + params->ScsSdCardEnabled = 0; + else + params->ScsSdCardEnabled = dev->enabled; params->Device4Enable = config->Device4Enable; -- cgit v1.2.3