Commit 4f28945d authored by Tianjia Zhang's avatar Tianjia Zhang Committed by Herbert Xu

X.509: fix error return value on the failed path

When memory allocation fails, an appropriate return value
should be set.

Fixes: 21552563 ("X.509: support OSCCA SM2-with-SM3 certificate verification")
Signed-off-by: default avatarTianjia Zhang <tianjia.zhang@linux.alibaba.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 10a2f0b3
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment