Commit 2716fbf6 authored by Jiri Slaby's avatar Jiri Slaby Committed by Herbert Xu

crypto: skcipher - avoid NULL dereference

Stanse found a potential NULL dereference in ablkcipher_next_slow.
Even though kmalloc fails, its retval is dereferenced later. Return
from that function properly earlier.
Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
Acked-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 0f0a8fa7
...@@ -165,7 +165,7 @@ static inline int ablkcipher_next_slow(struct ablkcipher_request *req, ...@@ -165,7 +165,7 @@ static inline int ablkcipher_next_slow(struct ablkcipher_request *req,
p = kmalloc(n, GFP_ATOMIC); p = kmalloc(n, GFP_ATOMIC);
if (!p) if (!p)
ablkcipher_walk_done(req, walk, -ENOMEM); return ablkcipher_walk_done(req, walk, -ENOMEM);
base = p + 1; base = p + 1;
......
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