crypto: ux500 - fix error return code in hash_dma_final()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Fri, 22 Mar 2013 13:18:44 +0000 (21:18 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Wed, 3 Apr 2013 01:06:28 +0000 (09:06 +0800)
Fix to return a negative error code from the error handling
case instead of 0, as returned elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/ux500/hash/hash_core.c

index 8d16d3a..d99b671 100644 (file)
@@ -939,6 +939,7 @@ static int hash_dma_final(struct ahash_request *req)
        if (!ctx->device->dma.nents) {
                dev_err(device_data->dev, "[%s] "
                                "ctx->device->dma.nents = 0", __func__);
+               ret = ctx->device->dma.nents;
                goto out;
        }
 
@@ -946,6 +947,7 @@ static int hash_dma_final(struct ahash_request *req)
        if (bytes_written != req->nbytes) {
                dev_err(device_data->dev, "[%s] "
                                "hash_dma_write() failed!", __func__);
+               ret = bytes_written;
                goto out;
        }