summaryrefslogtreecommitdiffstats
path: root/drivers/crypto
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2008-05-07 22:32:28 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2008-07-10 20:35:11 +0800
commit94eaa1bd7ca67e8f57919da96cbb41c215ef20cb (patch)
tree62aa9f538cc928e090baf714b75b0fa6125c9991 /drivers/crypto
parent9e70a408ad66846bc98dc026efe0384ef68373fc (diff)
downloadop-kernel-dev-94eaa1bd7ca67e8f57919da96cbb41c215ef20cb.zip
op-kernel-dev-94eaa1bd7ca67e8f57919da96cbb41c215ef20cb.tar.gz
[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 <kaber@trash.net> Acked-by: Evgeniy Polyakov <johnpol@2ka.mipt.ru> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto')
-rw-r--r--drivers/crypto/hifn_795x.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/crypto/hifn_795x.c b/drivers/crypto/hifn_795x.c
index cce6e6f..4e89cd8 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);
OpenPOWER on IntegriCloud