lkml.org 
[lkml]   [2015]   [Feb]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH] IOMMU-Tegra: gart: Delete an unnecessary check before the function call "vfree"
    From: Markus Elfring <elfring@users.sourceforge.net>
    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 <elfring@users.sourceforge.net>
    ---
    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;
    }
    --
    2.2.2


    \
     
     \ /
      Last update: 2015-02-05 18:41    [W:4.022 / U:0.176 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site