From patchwork Thu Feb 5 17:00:25 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: 436890 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 06BB11402A8 for ; Fri, 6 Feb 2015 04:00:42 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754196AbbBERAk (ORCPT ); Thu, 5 Feb 2015 12:00:40 -0500 Received: from mout.web.de ([212.227.15.3]:49443 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754107AbbBERAk (ORCPT ); Thu, 5 Feb 2015 12:00:40 -0500 Received: from [192.168.1.2] ([92.228.134.1]) by smtp.web.de (mrweb003) with ESMTPSA (Nemesis) id 0LvSQV-1XaUT01Xgx-010bPD; Thu, 05 Feb 2015 18:00:29 +0100 Message-ID: <54D3A1A9.9040709@users.sourceforge.net> Date: Thu, 05 Feb 2015 18:00:25 +0100 From: SF Markus Elfring User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Alexandre Courbot , Hiroshi Doyu , =?windows-1252?Q?J=F6rg_R=F6del?= , Stephen Warren , Thierry Reding , iommu@lists.linux-foundation.org, linux-tegra@vger.kernel.org CC: LKML , kernel-janitors@vger.kernel.org, Julia Lawall Subject: [PATCH] IOMMU-Tegra: gart: Delete an unnecessary check before the function call "vfree" 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> In-Reply-To: <5317A59D.4@users.sourceforge.net> X-Provags-ID: V03:K0:RFHlDuvBfE+j73s+bd7f68J9vXH2WRLd7eSmIk51PvLC6ME5y3x hautbeh26nYmmvwdkbq0YfXbolDfj8f0EpXNY7BYTDT7/6Pf+kzkcUWrI7lkQaedwjdVie0 FMYtDnBe0L0sZVW287wvrTZHCBQ3bjtajH7M4hfST0gMX3bPKk5mjXBYypEgOd0IFP9G2+c kCSaejcOBlGNmnLwGL4mg== X-UI-Out-Filterresults: notjunk:1; Sender: linux-tegra-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org From: Markus Elfring Date: Thu, 5 Feb 2015 17:54:16 +0100 The vfree() function performs also input parameter validation. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/iommu/tegra-gart.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/iommu/tegra-gart.c b/drivers/iommu/tegra-gart.c index f722a0c..07a795a 100644 --- a/drivers/iommu/tegra-gart.c +++ b/drivers/iommu/tegra-gart.c @@ -404,8 +404,7 @@ static int tegra_gart_remove(struct platform_device *pdev) struct gart_device *gart = platform_get_drvdata(pdev); writel(0, gart->regs + GART_CONFIG); - if (gart->savedata) - vfree(gart->savedata); + vfree(gart->savedata); gart_handle = NULL; return 0; }