aboutsummaryrefslogtreecommitdiff
path: root/ks_flash.c
diff options
context:
space:
mode:
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);