diff options
author | Subrata Banik <subrata.banik@intel.com> | 2018-10-06 14:29:44 +0530 |
---|---|---|
committer | Duncan Laurie <dlaurie@chromium.org> | 2018-10-09 20:11:21 +0000 |
commit | ee941635e668e48d704bbeef519b13b0b66ef38a (patch) | |
tree | 3afb835d7d2c60fd03e52a1ae73c2de4cd4cb362 /src | |
parent | 7cf9862657977ad7d7be2ff28c3f227faf611a2f (diff) |
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>
Diffstat (limited to 'src')
-rw-r--r-- | src/soc/intel/common/block/pcr/pcr.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/soc/intel/common/block/pcr/pcr.c b/src/soc/intel/common/block/pcr/pcr.c index b8d798ffe2..58eb13affa 100644 --- a/src/soc/intel/common/block/pcr/pcr.c +++ b/src/soc/intel/common/block/pcr/pcr.c @@ -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; } |