Skip to content

Commit 2716fbf

Browse files
Jiri Slabyherbertx
authored andcommitted
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: Jiri Slaby <jslaby@suse.cz> Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent 0f0a8fa commit 2716fbf

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎crypto/ablkcipher.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ static inline int ablkcipher_next_slow(struct ablkcipher_request *req,
165165

166166
p = kmalloc(n, GFP_ATOMIC);
167167
if (!p)
168-
ablkcipher_walk_done(req, walk, -ENOMEM);
168+
return ablkcipher_walk_done(req, walk, -ENOMEM);
169169

170170
base = p + 1;
171171

0 commit comments

Comments
 (0)