From patchwork Fri Jul 22 13:32:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Lambert X-Patchwork-Id: 9243575 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 BCA1E6088F for ; Fri, 22 Jul 2016 13:33:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AE28327F9A for ; Fri, 22 Jul 2016 13:33:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A307427FA5; Fri, 22 Jul 2016 13:33:22 +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 4FEF627F9A for ; Fri, 22 Jul 2016 13:33:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754512AbcGVNdJ (ORCPT ); Fri, 22 Jul 2016 09:33:09 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:33572 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754486AbcGVNdH (ORCPT ); Fri, 22 Jul 2016 09:33:07 -0400 Received: by mail-wm0-f68.google.com with SMTP id o80so6236136wme.0; Fri, 22 Jul 2016 06:33: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; bh=M3TqycSyG9VRhOAGvI1DykU/z9HA1lXcD6XzpkX4Mik=; b=F1k7v88uxtUhJGDPgH+Y0zBCs5Qlh6Zavu1pWH2GNLzjeN3v3zc3nTub4LpO9j+ba8 h9mcVpI1cy6BzHkQDzk9ulwHM9Kj14bdt1lFHJIMvHnSzBwiy6gasb43eIHQa80iyrvk f01FEqLzg20/x3kuEZw59F+8p5btJ212glsFdeJAnLp8cUykCtbelrbkn3KMBoqNi9e3 KlItj3TaEYweNVL8cyFaOUkped1qdf6w8vNsirLqmSiT8mMnZGk8pZHXGm+LewGbpiQz cRpphvxZWCUoP8tCi634dhetGZPqLsVVaB1FrrPNKHSXn4wIMAvpnyl2Yc7tlLPima2l OLTQ== 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; bh=M3TqycSyG9VRhOAGvI1DykU/z9HA1lXcD6XzpkX4Mik=; b=SXHg/QXtz6G+hVppVafSNQSwBXV0Cilqv0Dzm+IylhgHMotvxd940vnUOREgaEfNiV 3ggX7kf8vREfX+OIlA8opMdtUpuOopy4GLh6K65xjr5dUyjjk4WIHK3zDOhK5lriz2PX Ylb1jJIItv1CCIMoHrg4oRu69YTUOjnbq/ChnDIevFE91+StRdMJi8ctsktt9eanwpbk ckFmQYrq04IFbpt50In8RrrSzg9RXaKnynd77CggaXYLx42bgd4E9230YWPlv/IDz0UP O7esbW94Og07GoZGCqkMt23ZwB73uJlQEwT/i87ILA48dJmC65oBYP4xxcCy5JhZatwA OQgA== X-Gm-Message-State: ALyK8tJLSPMubHPtwO4pjAKU0Gp/Gh4pDOP0HknIGNj1uel3NvI/WvKvq1m3E5m2IRI+UQ== X-Received: by 10.28.229.19 with SMTP id c19mr27242538wmh.0.1469194375817; Fri, 22 Jul 2016 06:32:55 -0700 (PDT) Received: from sloth.lip6.fr (hp-quentin.rsr.lip6.fr. [132.227.76.76]) by smtp.gmail.com with ESMTPSA id p23sm12648015wme.8.2016.07.22.06.32.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Jul 2016 06:32:54 -0700 (PDT) From: Quentin Lambert To: Herbert Xu , "David S. Miller" , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, Quentin Lambert Subject: [PATCH 2/2] crypto: ixp4xx - Add missing npe_c release in error branches Date: Fri, 22 Jul 2016 15:32:41 +0200 Message-Id: <20160722133242.21916-2-lambert.quentin@gmail.com> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20160722133242.21916-1-lambert.quentin@gmail.com> References: <20160722133242.21916-1-lambert.quentin@gmail.com> 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 Most error branches following the call to npe_request contain a call to npe_request. This patch add a call to npe_release to error branches following the call to npe_request that do not have it. This issue was found with Hector. Signed-off-by: Quentin Lambert --- If I am right in thinking that these call to npe_release are missing, another solution would be to jump to err since the rest of the code does it. drivers/crypto/ixp4xx_crypto.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) -- 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 --- a/drivers/crypto/ixp4xx_crypto.c +++ b/drivers/crypto/ixp4xx_crypto.c @@ -448,7 +448,7 @@ static int init_ixp_crypto(struct device if (!npe_running(npe_c)) { ret = npe_load_firmware(npe_c, npe_name(npe_c), dev); if (ret) - return ret; + goto npe_release; if (npe_recv_message(npe_c, msg, "STATUS_MSG")) goto npe_error; } else { @@ -472,7 +472,8 @@ static int init_ixp_crypto(struct device default: printk(KERN_ERR "Firmware of %s lacks crypto support\n", npe_name(npe_c)); - return -ENODEV; + ret = -ENODEV; + goto npe_release; } /* buffer_pool will also be used to sometimes store the hmac, * so assure it is large enough @@ -511,6 +512,7 @@ npe_error: err: dma_pool_destroy(ctx_pool); dma_pool_destroy(buffer_pool); +npe_release: npe_release(npe_c); return ret; }