]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[HIFN]: Handle ablkcipher_walk errors
authorPatrick McHardy <kaber@trash.net>
Wed, 7 May 2008 14:32:28 +0000 (22:32 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 10 Jul 2008 12:35:11 +0000 (20:35 +0800)
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>
drivers/crypto/hifn_795x.c

index cce6e6f1baa5bc4dca4d08328dad1df830551df7..4e89cd8f664f3310b212c9eef4d17865156dca8d 100644 (file)
@@ -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);