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 <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>
This commit is contained in:
parent
e39a8a9c09
commit
bff8c5ec19
|
@ -539,7 +539,7 @@ static int lpss_i2c_gen_config_rise_fall_time(struct lpss_i2c_regs *regs,
|
||||||
|
|
||||||
if (soc == NULL) {
|
if (soc == NULL) {
|
||||||
printk(BIOS_ERR, "lpss_i2c: invalid SoC clock speed %d MHz\n",
|
printk(BIOS_ERR, "lpss_i2c: invalid SoC clock speed %d MHz\n",
|
||||||
soc->clk_speed_mhz);
|
ic_clk);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue