From: Patrick McHardy Date: Wed, 7 May 2008 14:32:28 +0000 (+0800) Subject: [HIFN]: Handle ablkcipher_walk errors X-Git-Tag: v2.6.27-rc1~1107^2~41 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=94eaa1bd7ca67e8f57919da96cbb41c215ef20cb;p=linux-2.6-omap-h63xx.git [HIFN]: Handle ablkcipher_walk errors 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 Acked-by: Evgeniy Polyakov Signed-off-by: Herbert Xu --- diff --git a/drivers/crypto/hifn_795x.c b/drivers/crypto/hifn_795x.c index cce6e6f1baa..4e89cd8f664 100644 --- a/drivers/crypto/hifn_795x.c +++ b/drivers/crypto/hifn_795x.c @@ -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);