From patchwork Sat Aug 20 10:48:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 9291711 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 54803600CB for ; Sat, 20 Aug 2016 10:51:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1C65528FAE for ; Sat, 20 Aug 2016 10:51:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0F5D728FB4; Sat, 20 Aug 2016 10:51:38 +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 A0DDC28FAE for ; Sat, 20 Aug 2016 10:51:37 +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 1bb3qH-0006jQ-MH; Sat, 20 Aug 2016 10:49:33 +0000 Received: from mail-pa0-x243.google.com ([2607:f8b0:400e:c03::243]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bb3qC-0006iA-NI for linux-arm-kernel@lists.infradead.org; Sat, 20 Aug 2016 10:49:29 +0000 Received: by mail-pa0-x243.google.com with SMTP id vy10so4793317pac.0 for ; Sat, 20 Aug 2016 03:49:06 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=59YlbMsDQbBOz05jtNDXeeaKqjWBs57nbdZtOGlqJUs=; b=V84zk5LcIyQtVlIwndJ9IOCj5EUiVtVpkLYc8TgIhKX114ensCtnD2o0BFALpcuWf/ K1IXAJ1OtaklcCb10rBP3VhvpOJxlLSDqqppA42bpyi0d2d7GoGiGzKZavF4C8nQ4lVC ZaB3+wIlXpeHptABnVwHvMolv326qdy909ExPGnREDyw6jFMBLxthnhQ8mN8MmW9r1Ud v2ruN0/ums11OZGcVOSXSaO9w2whkcuP1V7cA5UEazIs4Aw8+5OlWqqt08ovM8pM5O5n UnoUDok1wBif8ILz+kE1xWaQKrLR+aIDy429JuGhZbJLHlsBqHD0rC0gI09RqzTwxZMn FzIQ== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=59YlbMsDQbBOz05jtNDXeeaKqjWBs57nbdZtOGlqJUs=; b=eWxsYJyq7ADxm5GEhzeIURUalwlhvHKAkmKI18t0914MKEgsCfG52m96b60P/X5DBU C03Esv0HYmJArGiFa6Hdx1Zqgs/nuLP4fx9cYM8j371rppwwB3RxQGBEw5BG3QzNWVNW R0CQiC0v7E4/fgJCTjKvw8Eznq13wGlAVDx/JmHCaKrHCu8uLQ/eooTQpumy6f8ZmwS9 /MpDFiWJXlkojzCDUgsWudH5Kutbq1VK0q2YLR0pz2Ya7ND1f/7XkK620R2gdIPM7+6/ BU+TZx70h1TJEbkp3Toqj7Lv4/+5wlvDphmhIWhk1asCX8t2kOCY7lsJ0zzY7KvvuO6R YNDw== X-Gm-Message-State: AEkoouslX6EITFGnT/qekmzKWGzkpvxaGReEw4PR4yBGa6xhW9ANRbzX/v45qVJpnRj41Q== X-Received: by 10.66.244.199 with SMTP id xi7mr22262535pac.127.1471690146561; Sat, 20 Aug 2016 03:49:06 -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 uc1sm18049481pac.24.2016.08.20.03.48.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 20 Aug 2016 03:49:05 -0700 (PDT) From: Wei Yongjun To: Corentin Labbe , Herbert Xu , "David S. Miller" , Maxime Ripard , Chen-Yu Tsai Subject: [PATCH -next v2] crypto: sun4i-ss - fix missing unlock on error in sun4i_hash() Date: Sat, 20 Aug 2016 10:48:53 +0000 Message-Id: <1471690133-24396-1-git-send-email-weiyj.lk@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1471560130-5265-1-git-send-email-weiyj.lk@gmail.com> References: <1471560130-5265-1-git-send-email-weiyj.lk@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160820_034928_801401_7DBFCE54 X-CRM114-Status: GOOD ( 11.83 ) 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 Acked-by: Corentin LABBE --- v1 -> v2: goto release_ss as LABBE Corentin's suggestion --- drivers/crypto/sunxi-ss/sun4i-ss-hash.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/sunxi-ss/sun4i-ss-hash.c b/drivers/crypto/sunxi-ss/sun4i-ss-hash.c index 2ee3b59..1afeb8e 100644 --- a/drivers/crypto/sunxi-ss/sun4i-ss-hash.c +++ b/drivers/crypto/sunxi-ss/sun4i-ss-hash.c @@ -245,7 +245,8 @@ 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); - return -EINVAL; + err = -EINVAL; + goto release_ss; } } else { /* Since we have the flag final, we can go up to modulo 4 */