From 7ccb50f4352309813cffd98460bd7dcb48d4657f Mon Sep 17 00:00:00 2001 From: Vadim Bendebury Date: Fri, 31 May 2019 17:34:53 -0700 Subject: flash_log_vc: return proper error value Vendor command handler should return a vendor command error code which is ORed with VENDOR_RC_ERR by the vendor command routing function. Before this patch flash log vendor command handler was returning VENDOR_RC_ERR, which is filtered out by gsctool resulting in a return value of zero when there in fact is an error. BRANCH=cr50, cr50-mp BUG=b:132287488 TEST=with appropriate fixes in gsctool (coming in the next patch) was able to run concurrently for a long time a process constantly adding log entries using Cr50 CLI command, and a process constantly retrieving log entries using 'gsctool -L' Change-Id: I2094c0b342d65e6c2a382079f81fb10fc8bacab9 Signed-off-by: Vadim Bendebury Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1639093 Reviewed-by: Andrey Pronin --- common/flash_log_vc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/flash_log_vc.c b/common/flash_log_vc.c index 8ed85a57d4..5d1515a754 100644 --- a/common/flash_log_vc.c +++ b/common/flash_log_vc.c @@ -36,7 +36,7 @@ static enum vendor_cmd_rc vc_pop_log_entry(enum vendor_cmd_cc code, void *buf, *response_size = 1; ((uint8_t *)buf)[0] = -byte_size; - return VENDOR_RC_ERR; + return VENDOR_RC_INTERNAL_ERROR; } DECLARE_VENDOR_COMMAND(VENDOR_CC_POP_LOG_ENTRY, vc_pop_log_entry); -- cgit v1.2.1