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: 9565149 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 49DC56020C for ; Thu, 9 Feb 2017 16:51:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3669D284D1 for ; Thu, 9 Feb 2017 16:51:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 27D5428520; Thu, 9 Feb 2017 16:51:36 +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=-1.9 required=2.0 tests=BAYES_00 autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id AF2E1284D1 for ; Thu, 9 Feb 2017 16:51:35 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cbrwV-0004co-1N; Thu, 09 Feb 2017 16:51:35 +0000 Received: from exsmtp01.microchip.com ([198.175.253.37] helo=email.microchip.com) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cbrwE-0004KK-2C for linux-arm-kernel@lists.infradead.org; Thu, 09 Feb 2017 16:51:20 +0000 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: , , 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== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170209_085118_273433_8BB2AACB X-CRM114-Status: UNSURE ( 8.92 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Cyrille Pitchen , dan.carpenter@oracle.com, linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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;