Skip to content

Commit

Permalink
crypto: skcipher - avoid NULL dereference
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: David S. Miller <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
Jiri Slaby authored and herbertx committed Jun 23, 2010
1 parent 0f0a8fa commit 2716fbf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crypto/ablkcipher.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 2716fbf

Please sign in to comment.