From patchwork Thu Feb 9 16:51:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cyrille Pitchen X-Patchwork-Id: 9565163 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 98E4E6020C for ; Thu, 9 Feb 2017 16:53:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 889C6284D1 for ; Thu, 9 Feb 2017 16:53:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7DA27284FA; Thu, 9 Feb 2017 16:53:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E17AF284D1 for ; Thu, 9 Feb 2017 16:53:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932302AbdBIQxh (ORCPT ); Thu, 9 Feb 2017 11:53:37 -0500 Received: from exsmtp01.microchip.com ([198.175.253.37]:38249 "EHLO email.microchip.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752397AbdBIQxK (ORCPT ); Thu, 9 Feb 2017 11:53:10 -0500 Received: from tenerife.corp.atmel.com (10.10.76.4) by CHN-SV-EXCH01.mchp-main.com (10.10.76.37) with Microsoft SMTP Server id 14.3.181.6; Thu, 9 Feb 2017 09:50:56 -0700 From: Cyrille Pitchen To: , , CC: , , , , Cyrille Pitchen Subject: [PATCH next 1/2] crypto: atmel-sha: fix missing "return" instructions Date: Thu, 9 Feb 2017 17:51:20 +0100 Message-ID: X-Mailer: git-send-email 2.7.4 In-Reply-To: References: MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAC+NgFjrMKsWRWlGSWpSXmKPExsXCxeXDovtx7pwIg4/7H3dwWdz7fp7Z4vW/6SwWc863sFh0v5Kx2PT4GqvF/Xs/mSwu75rDZvHtcjO7A4fHgl9bWTy2rLzJ5LHtgKrH5iX1Hh+f3mLx+LxJLoAtijUzLym/IoE1Y8OhfqaCZuGK6wfeMDYwPuDvYuTiEBJYyyhxdNUfxi5GTg42AUOJtw+OsoLYIgKBEgtbXjGCFDELbGaU2PbvHRtIQljAT2L1y6fsIDaLgIrEyke/mEBsXoF4iasn/zKD2BICchI3z3WC2ZwCthKvTx0A6xUSsJFY8/QqM0S9oMTJmU9YQGxmAQmJgy9eMEPUqAEtXgE1J1Ci68RTJgjbSeLl0ZdsELadxOHpF9khbHuJs2s2s8PU/Ny1gxXC1pbY/moflK0jse1gPwuEbSuxZ8ZEqJnuEg8eLYeyfSVmPWyAqomSaFhwgmkCo8QsJKfOQnLqAkamVYzSzh5+usFhuq4Rzh4Ghnq5yRkFurmJmXl6yfm5mxghMaq6g/HWv/BDjJIcTEqivLIFcyKE+JLyUyozEosz4otKc1KLDzHKcHAoSfCenQ2UEyxKTU+tSMvMASYLmDQTB+chRgkOHiURXn+QGt7igsTc4sx0iPwpRkkpcd5GkIQASCKjNA+u9xKjqJQwbwdIjqcgtSg3swQifotRmOMhkxBLXn5eqhTQnQxAoMH4ilGcg1FJmHcDWH1mXgncjldA65mA1l8/PQtkfUkiQkqqgVF2xfKyFQ47J7yb2jhz436GZv3lP+3TIhXO8O8uF++tiVbkm39pYWtmrtCK8vNN0qJfv6w1dzr61L2ulce7aGnt9T4W99UnfzcymIdzpuvccSox/H18SYoO36/e0HdnFSeG75v4qPznHM+V6zo69jCcevBixf6Ch9ftmW0/JdR53jtn5XyX+5ESS3FGoqEW c1FxIgBYwiJ3VgMAAA== Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch fixes a previous patch: "crypto: atmel-sha - update request queue management to make it more generic". Indeed the patch above should have replaced the "return -EINVAL;" lines by "return atmel_sha_complete(dd, -EINVAL);" but instead replaced them by a simple call of "atmel_sha_complete(dd, -EINVAL);". Hence all "return" instructions were missing. Reported-by: Dan Carpenter Signed-off-by: Cyrille Pitchen --- drivers/crypto/atmel-sha.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/crypto/atmel-sha.c b/drivers/crypto/atmel-sha.c index 22d0c0c118da..d6c3d9529d36 100644 --- a/drivers/crypto/atmel-sha.c +++ b/drivers/crypto/atmel-sha.c @@ -668,7 +668,7 @@ static int atmel_sha_xmit_dma(struct atmel_sha_dev *dd, dma_addr_t dma_addr1, DMA_MEM_TO_DEV, DMA_PREP_INTERRUPT | DMA_CTRL_ACK); } if (!in_desc) - atmel_sha_complete(dd, -EINVAL); + return atmel_sha_complete(dd, -EINVAL); in_desc->callback = atmel_sha_dma_callback; in_desc->callback_param = dd; @@ -725,7 +725,7 @@ static int atmel_sha_xmit_dma_map(struct atmel_sha_dev *dd, if (dma_mapping_error(dd->dev, ctx->dma_addr)) { dev_err(dd->dev, "dma %u bytes error\n", ctx->buflen + ctx->block_size); - atmel_sha_complete(dd, -EINVAL); + return atmel_sha_complete(dd, -EINVAL); } ctx->flags &= ~SHA_FLAGS_SG; @@ -816,7 +816,7 @@ static int atmel_sha_update_dma_start(struct atmel_sha_dev *dd) if (dma_mapping_error(dd->dev, ctx->dma_addr)) { dev_err(dd->dev, "dma %u bytes error\n", ctx->buflen + ctx->block_size); - atmel_sha_complete(dd, -EINVAL); + return atmel_sha_complete(dd, -EINVAL); } if (length == 0) { @@ -830,7 +830,7 @@ static int atmel_sha_update_dma_start(struct atmel_sha_dev *dd) if (!dma_map_sg(dd->dev, ctx->sg, 1, DMA_TO_DEVICE)) { dev_err(dd->dev, "dma_map_sg error\n"); - atmel_sha_complete(dd, -EINVAL); + return atmel_sha_complete(dd, -EINVAL); } ctx->flags |= SHA_FLAGS_SG; @@ -844,7 +844,7 @@ static int atmel_sha_update_dma_start(struct atmel_sha_dev *dd) if (!dma_map_sg(dd->dev, ctx->sg, 1, DMA_TO_DEVICE)) { dev_err(dd->dev, "dma_map_sg error\n"); - atmel_sha_complete(dd, -EINVAL); + return atmel_sha_complete(dd, -EINVAL); } ctx->flags |= SHA_FLAGS_SG;