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: 9291709 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 A58B6600CB for ; Sat, 20 Aug 2016 10:49:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6281028F6B for ; Sat, 20 Aug 2016 10:49:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 40E6C28F71; Sat, 20 Aug 2016 10:49:09 +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.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham 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 DD0FF28F6B for ; Sat, 20 Aug 2016 10:49:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752379AbcHTKtI (ORCPT ); Sat, 20 Aug 2016 06:49:08 -0400 Received: from mail-pa0-f65.google.com ([209.85.220.65]:34408 "EHLO mail-pa0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751824AbcHTKtH (ORCPT ); Sat, 20 Aug 2016 06:49:07 -0400 Received: by mail-pa0-f65.google.com with SMTP id hh10so4810725pac.1 for ; Sat, 20 Aug 2016 03:49:07 -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=VHvekwN6HnIdeDZcVa6eQSeinhAab/nYBfejZ9CxVL8mDx+EdsdB2M+I75wrB0z0WK ogWjKtJz+NOpCp0VqfXAHEtfsTIprqEfi92PKn27yPQM4eYT9srwNqNspp41MKrrXfX8 FXUKCz6ZC3we+Ld2qGxdaZu1grR1dQ/TUL3lwGzmtWzkEl+6nk2SjGxdzXwnAONyFuFe CRPHTvqdY0YkWy4CV0QTK89FfuGIptVcxqJ/yC7qh+qjrM+W29Wgba7cbCiQgA2H9sxx ZMTJLONtVDN60jiCmOxy79SrX1rdZioYzjEJkKW+REQ/o8a2CA1wZ+9a4xn04wPA0sRh 3VHg== X-Gm-Message-State: AEkoouvCxI1nO3cRD0IGcFF7cd0r63/E/LhpnpCuq68GzrpVQdif4eEaupJ/aZsoKxlviw== 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 Cc: Wei Yongjun , linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org 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 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 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(-) -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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 */