Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755731AbbBGLcF (ORCPT ); Sat, 7 Feb 2015 06:32:05 -0500 Received: from www.osadl.org ([62.245.132.105]:41534 "EHLO www.osadl.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755352AbbBGLcD (ORCPT ); Sat, 7 Feb 2015 06:32:03 -0500 From: Nicholas Mc Guire To: Herbert Xu Cc: "David S. Miller" , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, Nicholas Mc Guire Subject: [PATCH RFC v2] crypto: sahara: pass on error condition Date: Sat, 7 Feb 2015 06:27:45 -0500 Message-Id: <1423308465-28222-1-git-send-email-hofrat@osadl.org> X-Mailer: git-send-email 1.7.10.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1388 Lines: 40 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 --- v2: cut&past error - the condition is not if (!ret) but if (ret) as sahara_hw_descriptor_create() will return 0 on success and -EINVAL in all failure paths. Patch was only compile tested with imx_v4_v5_defconfig CONFIG_CRYPTO_HW=y, CONFIG_CRYPTO_DEV_SAHARA=m Patch is against 3.19.0-rc7 (localversion-next is -next-20150204) drivers/crypto/sahara.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/crypto/sahara.c b/drivers/crypto/sahara.c index 0c790be..a9eeb8b 100644 --- a/drivers/crypto/sahara.c +++ b/drivers/crypto/sahara.c @@ -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)); -- 1.7.10.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/