From bff8c5ec1977039b7edd1de02768c44a7055fce9 Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Fri, 18 Nov 2016 08:10:35 -0600 Subject: 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. Change-Id: I5021ad8c1581d1935b39875ffa3aa00b594c537a 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 --- 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; } -- cgit v1.2.3