Skip to content

Commit

Permalink
secvar_api: check that enqueue_update writes successfully before retu…
Browse files Browse the repository at this point in the history
…rning 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 <erichte@linux.ibm.com>
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
  • Loading branch information
erichte-ibm authored and oohal committed Dec 5, 2019
1 parent a55c46d commit 6cdbf1a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions libstb/secvar/secvar_api.c
Expand Up @@ -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);

0 comments on commit 6cdbf1a

Please sign in to comment.