From 9b57952612f6d224b9d9f685e90e83b16228dc40 Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Fri, 18 Nov 2016 08:10:35 -0600 Subject: [PATCH] UPSTREAM: soc/intel/common/lpss_i2c: fix NULL dereference in error path If the SoC clock speed is not supported there is supposed to be an error printed. However, the value printed was wrong which was dereferencing a NULL struct. Fix that. BUG=None BRANCH=None TEST=None Found-by: Coverity Scan #1365977 Signed-off-by: Aaron Durbin Reviewed-on: https://review.coreboot.org/17468 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel Reviewed-by: Furquan Shaikh Change-Id: I5021ad8c1581d1935b39875ffa3aa00b594c537a Reviewed-on: https://chromium-review.googlesource.com/413242 Commit-Ready: Furquan Shaikh Tested-by: Furquan Shaikh Reviewed-by: Aaron Durbin --- src/soc/intel/common/lpss_i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/soc/intel/common/lpss_i2c.c b/src/soc/intel/common/lpss_i2c.c index 49fb85d6a6..025ee25f57 100644 --- a/src/soc/intel/common/lpss_i2c.c +++ b/src/soc/intel/common/lpss_i2c.c @@ -539,7 +539,7 @@ static int lpss_i2c_gen_config_rise_fall_time(struct lpss_i2c_regs *regs, if (soc == NULL) { printk(BIOS_ERR, "lpss_i2c: invalid SoC clock speed %d MHz\n", - soc->clk_speed_mhz); + ic_clk); return -1; }