aboutsummaryrefslogtreecommitdiff
path: root/libstb
diff options
context:
space:
mode:
authorEric Richter <erichte@linux.ibm.com>2019-12-03 18:03:48 -0600
committerOliver O'Halloran <oohall@gmail.com>2019-12-05 17:29:56 +1100
commit6cdbf1aded81b54c5f08194e09506ecf32686baa (patch)
treed827a6611a63096170515b3c628391fae0cfc8eb /libstb
parenta55c46d5a1be0efd2f0c74755cfb8facb1255361 (diff)
downloadskiboot-6cdbf1aded81b54c5f08194e09506ecf32686baa.zip
skiboot-6cdbf1aded81b54c5f08194e09506ecf32686baa.tar.gz
skiboot-6cdbf1aded81b54c5f08194e09506ecf32686baa.tar.bz2
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 <erichte@linux.ibm.com> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Diffstat (limited to 'libstb')
-rw-r--r--libstb/secvar/secvar_api.c7
1 files changed, 4 insertions, 3 deletions
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);