Commit 94eaa1bd authored by Patrick McHardy's avatar Patrick McHardy Committed by Herbert Xu

[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: default avatarPatrick McHardy <kaber@trash.net>
Acked-by: default avatarEvgeniy Polyakov <johnpol@2ka.mipt.ru>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 9e70a408
...@@ -1602,7 +1602,10 @@ static int hifn_setup_session(struct ablkcipher_request *req) ...@@ -1602,7 +1602,10 @@ static int hifn_setup_session(struct ablkcipher_request *req)
idx = 0; idx = 0;
sg_num = ablkcipher_walk(req, &ctx->walk); 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); atomic_set(&ctx->sg_num, sg_num);
spin_lock_irqsave(&dev->lock, flags); spin_lock_irqsave(&dev->lock, flags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment