Harshit Sharma has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/41654 )
Change subject: drivers/ipmi: Avoid NULL pointer dereference ......................................................................
drivers/ipmi: Avoid NULL pointer dereference
There are multiple instances where NULL pointer conf could be dereferenced. This patch fixes those issues.
Found-by: Coverity Scan #1407751, #1428709, #1428710, #1428714 Signed-off-by: Harshit Sharma harshitsharmajs@gmail.com Change-Id: I2d1cfe3f9b55288eeb55ab8785d857993e3989c0 --- M src/drivers/ipmi/ipmi_kcs_ops.c 1 file changed, 9 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/54/41654/1
diff --git a/src/drivers/ipmi/ipmi_kcs_ops.c b/src/drivers/ipmi/ipmi_kcs_ops.c index 0b90fb2..e43f3a5 100644 --- a/src/drivers/ipmi/ipmi_kcs_ops.c +++ b/src/drivers/ipmi/ipmi_kcs_ops.c @@ -84,6 +84,9 @@ if (dev->chip_info) conf = dev->chip_info;
+ if (!conf) + return; + /* Get IPMI version for ACPI and SMBIOS */ if (conf && conf->wait_for_bmc && conf->bmc_boot_timeout) { struct stopwatch sw; @@ -200,6 +203,9 @@ if (dev->chip_info) conf = dev->chip_info;
+ if (!conf) + return 0; + if (conf) { if (conf->have_gpe) gpe_interrupt = conf->gpe_interrupt; @@ -234,6 +240,9 @@ if (dev->chip_info) conf = dev->chip_info;
+ if (!conf) + return; + /* Use command to pass UID to ipmi_write_acpi_tables */ conf->uid = uid_cnt++;