Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -165,7 +165,7 @@ static inline int ablkcipher_next_slow(struct ablkcipher_request *req,

	p = kmalloc(n, GFP_ATOMIC);
	if (!p)
		ablkcipher_walk_done(req, walk, -ENOMEM);
		return ablkcipher_walk_done(req, walk, -ENOMEM);

	base = p + 1;