summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crypto/userspace/ncr-key.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/crypto/userspace/ncr-key.c b/crypto/userspace/ncr-key.c
index 7e8672770af..b9aee067d3a 100644
--- a/crypto/userspace/ncr-key.c
+++ b/crypto/userspace/ncr-key.c
@@ -482,10 +482,8 @@ size_t size;
ret = 0;
fail:
- if (item) {
- if (ret < 0) item->type = NCR_KEY_TYPE_INVALID;
- _ncr_key_item_put(item);
- }
+ if (ret < 0) item->type = NCR_KEY_TYPE_INVALID;
+ _ncr_key_item_put(item);
return ret;
}
@@ -778,8 +776,7 @@ struct key_item_st* newkey = NULL;
}
fail:
- if (key)
- _ncr_key_item_put(key);
+ _ncr_key_item_put(key);
if (newkey)
_ncr_key_item_put(newkey);
return ret;