]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
crypto: algif_skcipher - set error code when kcalloc fails
authorPan Bian <bianpan2016@163.com>
Thu, 1 Dec 2016 02:04:43 +0000 (10:04 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 1 Dec 2016 13:06:43 +0000 (21:06 +0800)
commite2c1b82330bcd77ffeb6dc5a18a4c6ce8d3e1fd3
treecaf2188d54cd65ebbe14d8d3ac8227aec0032b4a
parent37d8468108efb19b80aa8484534f8850ed60dbfb
crypto: algif_skcipher - set error code when kcalloc fails

Fix bug https://bugzilla.kernel.org/show_bug.cgi?id=188521. In function
skcipher_recvmsg_async(), variable err takes the return value, and its
value should be negative on failures. Because variable err may be
reassigned and checked before calling kcalloc(), its value may be 0
(indicates no error) even if kcalloc() fails. This patch fixes the bug
by explicitly assigning -ENOMEM to err when kcalloc() returns a NULL
pointer.

Signed-off-by: Pan Bian <bianpan2016@163.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/algif_skcipher.c