summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crypto/asymmetric_keys/public_key_sm2.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/crypto/asymmetric_keys/public_key_sm2.c b/crypto/asymmetric_keys/public_key_sm2.c
index 7325cf21dbb4..66b614e1eccd 100644
--- a/crypto/asymmetric_keys/public_key_sm2.c
+++ b/crypto/asymmetric_keys/public_key_sm2.c
@@ -36,8 +36,10 @@ int cert_sig_digest_update(const struct public_key_signature *sig,
desc_size = crypto_shash_descsize(tfm) + sizeof(*desc);
desc = kzalloc(desc_size, GFP_KERNEL);
- if (!desc)
+ if (!desc) {
+ ret = -ENOMEM;
goto error_free_tfm;
+ }
desc->tfm = tfm;