From patchwork Thu Aug 18 22:42:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 9288729 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 3F85C607FF for ; Thu, 18 Aug 2016 22:44:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3371F2929C for ; Thu, 18 Aug 2016 22:44:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 27443292BE; Thu, 18 Aug 2016 22:44:05 +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=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CEEEB2929C for ; Thu, 18 Aug 2016 22:44:04 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1baW1V-0003lx-Dd; Thu, 18 Aug 2016 22:42:53 +0000 Received: from mail-pf0-x244.google.com ([2607:f8b0:400e:c00::244]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1baW1D-0003fN-UF for linux-arm-kernel@lists.infradead.org; Thu, 18 Aug 2016 22:42:36 +0000 Received: by mail-pf0-x244.google.com with SMTP id i6so386774pfe.0 for ; Thu, 18 Aug 2016 15:42:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=dj6XR1Bjs9L+Z1em/uJXKvH7fZ7inioPBULyPEsNgCQ=; b=c+989pMH4mAuCf3S1L/QEH/wey/8zbPrEYHcU/Ua3g7IJ8yN4zmMq7UeRM78wUHi3w 0pCg8wBe0cbYGTKG6Wqkkkvc0NqjZpp25d39gmhxBHdeG5MgHoLteEkW3+ntzURVmncd pN1XlUbUFPogf5Jbbhbves0p6ydJU16glggytc0++vqLcsk8Z3CIWDp1zWkd5+kXRC8k C5cKulC5O758qEWdLaUUtpG2kfmpeWurgmPzonVNRD4vtSh+2DD2npzoWyrIZOK/E0LM 6uuN4GkG/nn/ww6tjIRp32ArG/T5dizv9cJgSsTQtbsmUYOLz9kX5shxonWsDhqWjedA GznQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=dj6XR1Bjs9L+Z1em/uJXKvH7fZ7inioPBULyPEsNgCQ=; b=bMSOg6awNpBZ2fPcjfO6hlvKlHLAOMBMs4vytSBcVRm7PGBWjRc27WFWCXbAkkQRHi QTK3Cc7AY2RBCOSLJJii4nTwRasD5OfgqzDliBMcL4OuMCiT633Ai0EH4+kqFr/H9xFr 5r4kkU4OQRWGqX3wTzAtsadG/55BpySFGaoagBnt2OLhJ3i1nx+S3kP8CJ5d7qNZMarf Ap4+PI87h7BeGoaUmzldhehaELS61LWO6lJd+Am1hP5sqM/MDDyJQyHbW+SW2q1iFy0j 3SbxwenWLVVhslGtTSlLV4UQuwuBAODeu0YzVzoxP3o4nTHWc0xSxHH8aMPlHKusZaS5 vHJg== X-Gm-Message-State: AEkooutwH4YOIl6KwmDTEKV9odfxT5yDeFfUwX4ZP5KK+JtJXU4YA00/jOdxydkBIEfIIQ== X-Received: by 10.98.14.208 with SMTP id 77mr8156278pfo.23.1471560136905; Thu, 18 Aug 2016 15:42:16 -0700 (PDT) Received: from localhost.localdomain.localdomain (ec2-52-192-197-227.ap-northeast-1.compute.amazonaws.com. [52.192.197.227]) by smtp.gmail.com with ESMTPSA id i137sm1140749pfe.64.2016.08.18.15.42.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Aug 2016 15:42:16 -0700 (PDT) From: Wei Yongjun To: Corentin Labbe , Herbert Xu , "David S. Miller" , Maxime Ripard , Chen-Yu Tsai Subject: [PATCH -next] crypto: fix missing unlock on error in sun4i_hash() Date: Thu, 18 Aug 2016 22:42:10 +0000 Message-Id: <1471560130-5265-1-git-send-email-weiyj.lk@gmail.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160818_154236_082950_17AEC7EE X-CRM114-Status: GOOD ( 10.46 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Wei Yongjun , linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.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 Add the missing unlock before return from function sun4i_hash() in the error handling case. Fixes: 477d9b2e591b ("crypto: sun4i-ss - unify update/final function") Signed-off-by: Wei Yongjun --- drivers/crypto/sunxi-ss/sun4i-ss-hash.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/crypto/sunxi-ss/sun4i-ss-hash.c b/drivers/crypto/sunxi-ss/sun4i-ss-hash.c index 2ee3b59..de66f47 100644 --- a/drivers/crypto/sunxi-ss/sun4i-ss-hash.c +++ b/drivers/crypto/sunxi-ss/sun4i-ss-hash.c @@ -245,6 +245,7 @@ int sun4i_hash(struct ahash_request *areq) if (end > areq->nbytes || areq->nbytes - end > 63) { dev_err(ss->dev, "ERROR: Bound error %u %u\n", end, areq->nbytes); + spin_unlock(&ss->slock); return -EINVAL; } } else {