aboutsummaryrefslogtreecommitdiff
path: root/ks_token.c
diff options
context:
space:
mode:
Diffstat (limited to 'ks_token.c')
-rw-r--r--ks_token.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ks_token.c b/ks_token.c
index c2ebee2..6172f79 100644
--- a/ks_token.c
+++ b/ks_token.c
@@ -338,6 +338,11 @@ static hal_error_t ks_token_init(hal_ks_t *ks, const int alloc)
unsigned b;
+ if ((block = hal_ks_cache_pick_lru(ks)) == NULL) {
+ err = HAL_ERROR_IMPOSSIBLE;
+ goto done;
+ }
+
memset(block, 0xFF, sizeof(*block));
block->header.block_type = HAL_KS_BLOCK_TYPE_PIN;