crypto: sahara - pass on error condition
authorNicholas Mc Guire <hofrat@osadl.org>
Sat, 7 Feb 2015 11:27:45 +0000 (06:27 -0500)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sat, 28 Feb 2015 10:31:36 +0000 (23:31 +1300)
A failure of sahara_hw_descriptor_create() with -EINVAL due to scatter list
out of bounds/invalid would not be reported back. This patch just passes on
the -EINVAL so it is visible in sahara_queue_manage().

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/sahara.c

index b65e2a5ab46f06d1a61d6c6b4e0f268fb05f14fc..822978d823aa9569dabbd1a568ec4d517919bedb 100644 (file)
@@ -602,6 +602,8 @@ static int sahara_aes_process(struct ablkcipher_request *req)
        reinit_completion(&dev->dma_completion);
 
        ret = sahara_hw_descriptor_create(dev);
+       if (ret)
+               return -EINVAL;
 
        timeout = wait_for_completion_timeout(&dev->dma_completion,
                                msecs_to_jiffies(SAHARA_TIMEOUT_MS));