From patchwork Sun Nov 15 18:49:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 7619521 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Original-To: patchwork-linux-crypto@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2C5E79F1D3 for ; Sun, 15 Nov 2015 18:50:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 42F2C205B9 for ; Sun, 15 Nov 2015 18:50:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2BC1F205B8 for ; Sun, 15 Nov 2015 18:49:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752238AbbKOSt4 (ORCPT ); Sun, 15 Nov 2015 13:49:56 -0500 Received: from mout.web.de ([212.227.15.4]:54926 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751856AbbKOStz (ORCPT ); Sun, 15 Nov 2015 13:49:55 -0500 Received: from [192.168.1.3] ([77.182.168.43]) by smtp.web.de (mrweb003) with ESMTPSA (Nemesis) id 0M2MZY-1aGX9Y3Llc-00s2lC; Sun, 15 Nov 2015 19:49:20 +0100 Subject: [PATCH 1/4] crypto-ixp4xx: Delete unnecessary checks before the function call "dma_pool_destroy" To: "David S. Miller" , Herbert Xu , linux-crypto@vger.kernel.org References: <5307CAA2.8060406@users.sourceforge.net> <530A086E.8010901@users.sourceforge.net> <530A72AA.3000601@users.sourceforge.net> <530B5FB6.6010207@users.sourceforge.net> <530C5E18.1020800@users.sourceforge.net> <530CD2C4.4050903@users.sourceforge.net> <530CF8FF.8080600@users.sourceforge.net> <530DD06F.4090703@users.sourceforge.net> <5317A59D.4@users.sourceforge.net> <5648D2C1.8050603@users.sourceforge.net> Cc: LKML , kernel-janitors@vger.kernel.org, Julia Lawall From: SF Markus Elfring Message-ID: <5648D3AC.6090904@users.sourceforge.net> Date: Sun, 15 Nov 2015 19:49:16 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <5648D2C1.8050603@users.sourceforge.net> X-Provags-ID: V03:K0:54Sd9mlQf0wCexpy7sIzOUQZWsPXTErl9E7lSVLVmmtzkHhh+Ld dbmA38w7IHAOUdzLdl4Luq5rz6P9euFgz1P4otNMP/Hr3ZgDRdGbIm93gq+/orJxHdY8Dlt QfIaCLNhlOGzB8hzL031smE+Q4FgOO0c/jYsZ1cr6UYfD9aifbjABTn2WVqftcawy/pCLtY mSGcXX1IYFuaL2iIT1cdg== X-UI-Out-Filterresults: notjunk:1; V01:K0:a8YXVjfhULc=:d5In/i2GWTx7EbmyLYf5+B uQihflwaRfSflCv7jc2UampvmqgOvRwYx8RDiM6CMKns9pOjwGZ7jBaYMINLC3gekAygVG/th T8qMYwpnX5RfuTiPgv8xppU8X9vHzIX/euPGgVdO4KaGNuurAiOSCen50uGC0+CY4H4a+8u+p pOPTUlY6Had9NPeIPGgEqskwGF00RHkWg8KihBegxgUnVHDIi1NVlVdGVdNwYn5fThRZS1heG Vfx88Pr0CIKpOc4wLJW2Ym51qA+YLm7aUQrahsF0vm7ZRSNeodagOZ3Fqv7EqNJqwtygKsbex ZySYrACGf1IXKuSaifSQX32pVHgpV3bUFb6JCh7k8Xo0utfIdldzSfHzdrGVpn/UxV6hV/nBi ULGwQFAmHnr9LnFk71UCQSrxoNT27ybtv29YcxlILEdCs6jDku1MIh54lkKGrZ66IrHARPEB0 1UnQ1FQdfB9OMJ7Irkio1HJC0+q8W8dNS3P6AsO84EyXBJsIkjel8+iLitxscpBEIUyx75BCN GPKTx8hx7kf9D4nozwVnIRFi8CTNx0Qw69WdhslIdotgla6r/R3g5pcF9YbnHOOWjXi7XsSlL eLvzlRew23SqAMmX0nzXwDby43uURV9oDt6r8LQeV/imNe791IqODzpEYUuBYoqZB9V7l9wf3 kbDyVnGXYClfJ9b8NQ/N7HePAvaKMKP/9gg9pKAJ80pBTACS6md8+2kKmWTW+kTj6UhGrAkqL v5utMESCIoAtD7qjJVWHhNrmUSyEyJojnWe/9uujmLU5Bxu+RLZKM/0if9uqzJwOCIVEQoGIe Dklf6DD Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Sun, 15 Nov 2015 16:51:21 +0100 The dma_pool_destroy() function tests whether its argument is NULL and then returns immediately. Thus the test around the calls is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/crypto/ixp4xx_crypto.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/ixp4xx_crypto.c b/drivers/crypto/ixp4xx_crypto.c index 8f27903..e52496a 100644 --- a/drivers/crypto/ixp4xx_crypto.c +++ b/drivers/crypto/ixp4xx_crypto.c @@ -510,10 +510,8 @@ npe_error: printk(KERN_ERR "%s not responding\n", npe_name(npe_c)); ret = -EIO; err: - if (ctx_pool) - dma_pool_destroy(ctx_pool); - if (buffer_pool) - dma_pool_destroy(buffer_pool); + dma_pool_destroy(ctx_pool); + dma_pool_destroy(buffer_pool); npe_release(npe_c); return ret; }