Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

keys: asymmetric: fix error return code in software_key_query()

Fix to return negative error code -ENOMEM from kmalloc() error handling
case instead of 0, as done elsewhere in this function.

Fixes: f1774cb8956a ("X.509: parse public key parameters from x509 for akcipher")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Wei Yongjun and committed by
Linus Torvalds
6cbba1f9 811f04ba

+1
+1
crypto/asymmetric_keys/public_key.c
··· 119 119 if (IS_ERR(tfm)) 120 120 return PTR_ERR(tfm); 121 121 122 + ret = -ENOMEM; 122 123 key = kmalloc(pkey->keylen + sizeof(u32) * 2 + pkey->paramlen, 123 124 GFP_KERNEL); 124 125 if (!key)