aboutsummaryrefslogtreecommitdiff
path: root/ks_flash.c
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2016-09-27 12:55:42 -0400
committerRob Austein <sra@hactrn.net>2016-09-27 12:55:42 -0400
commit5e127578f0c68ee9baa67d867d75c6a714bd1176 (patch)
tree404541d5ed9638f149519a9b5d77d40358318f65 /ks_flash.c
parent84aaee3b36c11950e194c0918afc04331253abe0 (diff)
Add hal_ks_index_replace().
Diffstat (limited to 'ks_flash.c')
-rw-r--r--ks_flash.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/ks_flash.c b/ks_flash.c
index c53347b..895f7df 100644
--- a/ks_flash.c
+++ b/ks_flash.c
@@ -1012,16 +1012,11 @@ static hal_error_t update_pin_block(const unsigned b1,
* the all-zeros UUID). Maybe later.
*/
- if ((err = hal_ks_index_delete(&db.ksi, &pin_uuid, &b2)) != HAL_OK)
+ if ((err = hal_ks_index_replace(&db.ksi, &pin_uuid, &b2)) != HAL_OK)
return err;
- if (b2 != b1)
- return HAL_ERROR_IMPOSSIBLE;
-
block->pin = *new_data;
- err = hal_ks_index_add(&db.ksi, &pin_uuid, &b2);
-
if (err == HAL_OK)
cache_mark_used(block, b2);