From 6cdbf1aded81b54c5f08194e09506ecf32686baa Mon Sep 17 00:00:00 2001 From: Eric Richter Date: Tue, 3 Dec 2019 18:03:48 -0600 Subject: secvar_api: check that enqueue_update writes successfully before returning success 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 Signed-off-by: Oliver O'Halloran --- libstb/secvar/secvar_api.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'libstb') diff --git a/libstb/secvar/secvar_api.c b/libstb/secvar/secvar_api.c index 2dd2638..349e8be 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); -- cgit v1.1