Skip to content

Commit

Permalink
[HIFN]: Handle ablkcipher_walk errors
Browse files Browse the repository at this point in the history
    
ablkcipher_walk may return a negative error value, handle this properly
instead of treating it as a huge number of scatter-gather elements.
    
Signed-off-by: Patrick McHardy <kaber@trash.net>
Acked-by: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
  • Loading branch information
Patrick McHardy authored and Herbert Xu committed Jul 10, 2008
1 parent 9e70a40 commit 94eaa1b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/crypto/hifn_795x.c
Original file line number Diff line number Diff line change
Expand Up @@ -1602,7 +1602,10 @@ static int hifn_setup_session(struct ablkcipher_request *req)
idx = 0;

sg_num = ablkcipher_walk(req, &ctx->walk);

if (sg_num < 0) {
err = sg_num;
goto err_out_exit;
}
atomic_set(&ctx->sg_num, sg_num);

spin_lock_irqsave(&dev->lock, flags);
Expand Down

0 comments on commit 94eaa1b

Please sign in to comment.