From: Wei Yongjun Date: Fri, 22 Mar 2013 13:18:44 +0000 (+0800) Subject: crypto: ux500 - fix error return code in hash_dma_final() X-Git-Tag: v3.10-rc1~112^2~37 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=eb16796302bad44fd346d4e0e15f8086132d1363;p=platform%2Fkernel%2Flinux-3.10.git crypto: ux500 - fix error return code in hash_dma_final() 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 Acked-by: Linus Walleij Signed-off-by: Herbert Xu --- diff --git a/drivers/crypto/ux500/hash/hash_core.c b/drivers/crypto/ux500/hash/hash_core.c index 8d16d3a..d99b671 100644 --- a/drivers/crypto/ux500/hash/hash_core.c +++ b/drivers/crypto/ux500/hash/hash_core.c @@ -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; }