soc/intel/common/block/pcr: Add NULL pointer check in pcr_execute_sideband_msg()
This patch to fix KW issue due to msg, data and response pointers NULL check fail. Change-Id: I39324514079f240ba1683a04e579de85485299bf Signed-off-by: Subrata Banik <subrata.banik@intel.com> Reviewed-on: https://review.coreboot.org/28949 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Furquan Shaikh <furquan@google.com>
This commit is contained in:
parent
7cf9862657
commit
ee941635e6
|
@ -263,7 +263,12 @@ int pcr_execute_sideband_msg(struct pcr_sbi_msg *msg, uint32_t *data,
|
||||||
uint16_t sbi_status;
|
uint16_t sbi_status;
|
||||||
uint16_t sbi_rid;
|
uint16_t sbi_rid;
|
||||||
|
|
||||||
assert(msg && data && response);
|
if (!msg || !data || !response) {
|
||||||
|
printk(BIOS_ERR, "Pointer checked for NULL Fail! "
|
||||||
|
"msg = %p \t data = %p \t response = %p\n",
|
||||||
|
msg, data, response);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
switch (msg->opcode) {
|
switch (msg->opcode) {
|
||||||
case MEM_READ:
|
case MEM_READ:
|
||||||
|
@ -275,7 +280,8 @@ int pcr_execute_sideband_msg(struct pcr_sbi_msg *msg, uint32_t *data,
|
||||||
case GPIO_LOCK_UNLOCK:
|
case GPIO_LOCK_UNLOCK:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
printk(BIOS_ERR, "SBI Failure: Wrong Input!\n");
|
printk(BIOS_ERR, "SBI Failure: Wrong Input = %x!\n",
|
||||||
|
msg->opcode);
|
||||||
return -1;
|
return -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue