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 <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/17468
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Furquan Shaikh <furquan@google.com>

Change-Id: I5021ad8c1581d1935b39875ffa3aa00b594c537a
Reviewed-on: https://chromium-review.googlesource.com/413242
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
Aaron Durbin 2016-11-18 08:10:35 -06:00 committed by chrome-bot
commit 9b57952612

View file

@ -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;
}