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:
Subrata Banik 2018-10-06 14:29:44 +05:30 committed by Duncan Laurie
parent 7cf9862657
commit ee941635e6
1 changed files with 8 additions and 2 deletions

View File

@ -263,7 +263,12 @@ int pcr_execute_sideband_msg(struct pcr_sbi_msg *msg, uint32_t *data,
uint16_t sbi_status;
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) {
case MEM_READ:
@ -275,7 +280,8 @@ int pcr_execute_sideband_msg(struct pcr_sbi_msg *msg, uint32_t *data,
case GPIO_LOCK_UNLOCK:
break;
default:
printk(BIOS_ERR, "SBI Failure: Wrong Input!\n");
printk(BIOS_ERR, "SBI Failure: Wrong Input = %x!\n",
msg->opcode);
return -1;
break;
}