[Skiboot] [PATCH 2/3] secvar_api: check that enqueue_update writes successfully before returning success

Eric Richter erichte at linux.ibm.com
Wed Dec 4 11:03:48 AEDT 2019


The return code to the storage driver's write function was previously
being ignored, so failures to write were not propogated to the API
consumer. This patch fixes secvar_enqueue_update() to properly return
the expected OPAL_HARDWARE return code if the storage driver's write
function returns an error.

Signed-off-by: Eric Richter <erichte at linux.ibm.com>
---
 libstb/secvar/secvar_api.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/libstb/secvar/secvar_api.c b/libstb/secvar/secvar_api.c
index 2dd2638b..349e8bef 100644
--- a/libstb/secvar/secvar_api.c
+++ b/libstb/secvar/secvar_api.c
@@ -151,8 +151,9 @@ static int64_t opal_secvar_enqueue_update(const char *key, uint64_t key_len, voi
 	list_add_tail(&update_bank, &node->link);
 
 out:
-	secvar_storage.write_bank(&update_bank, SECVAR_UPDATE_BANK);
-
-	return OPAL_SUCCESS;
+	if (secvar_storage.write_bank(&update_bank, SECVAR_UPDATE_BANK))
+		return OPAL_HARDWARE;
+	else
+		return OPAL_SUCCESS;
 }
 opal_call(OPAL_SECVAR_ENQUEUE_UPDATE, opal_secvar_enqueue_update, 4);
-- 
2.21.0



More information about the Skiboot mailing list