From 8c53e6a053ac82a54c681b40fdd075aab3414e19 Mon Sep 17 00:00:00 2001 From: Dinesh Gehlot Date: Mon, 8 May 2023 05:15:53 +0000 Subject: soc/intel/cmn/blk.cse: Fix check condition in store_cse_rw_fw_version() The return value of cse_get_bp_info() is an enum integer, where zero means success and non-zero means failure. The function store_cse_rw_fw_version() calls the function cse_get_bp_info() and validates the return value as a boolean causing prematurely returns of the parent API even if cse_get_bp_info() is successful. This patch corrects this logical error by returning only if cse_get_bp_info() fails. TEST=Build and boot google/nivviks and verify that the ISH version info command is only being sent during cold boot. Signed-off-by: Dinesh Gehlot Change-Id: Ice278e5ac69ff2f2c9f1936b76d71ae9deb6f855 Reviewed-on: https://review.coreboot.org/c/coreboot/+/74998 Reviewed-by: Kapil Porwal Reviewed-by: Paul Menzel Reviewed-by: Subrata Banik Tested-by: build bot (Jenkins) Reviewed-by: Sridhar Siricilla --- src/soc/intel/common/block/cse/cse_lite.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/soc/intel/common/block/cse/cse_lite.c b/src/soc/intel/common/block/cse/cse_lite.c index 460910bf30..733f68bc38 100644 --- a/src/soc/intel/common/block/cse/cse_lite.c +++ b/src/soc/intel/common/block/cse/cse_lite.c @@ -1181,7 +1181,7 @@ static void store_cse_rw_fw_version(void) return; struct get_bp_info_rsp cse_bp_info; - if (!cse_get_bp_info(&cse_bp_info)) { + if (cse_get_bp_info(&cse_bp_info) != CB_SUCCESS) { printk(BIOS_ERR, "cse_lite: Failed to get CSE boot partition info\n"); return; } -- cgit v1.2.3