[<prev] [next>] [day] [month] [year] [list]
Date: Sun, 05 May 2013 18:07:01 +0800
From: Libo Chen <chenlibo.3@...il.com>
To: davidb@...eaurora.org, ohad@...ery.com, joerg.roedel@....com,
akpm@...ux-foundation.org, torvalds@...ux-foundation.org
CC: linux-kernel@...r.kernel.org, lizefan@...wei.com,
libo.chen@...wei.com
Subject: [PATCH 2/2] msm: iommu: no need kfree before kzalloc successful
From: libo.chen@...wei.com
We don`t need to kfree drvdata before kzalloc successful
Signed-off-by: Libo Chen <libo.chen@...wei.com>
---
drivers/iommu/msm_iommu_dev.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/iommu/msm_iommu_dev.c b/drivers/iommu/msm_iommu_dev.c
index 4351a2d..c6c6de1 100644
--- a/drivers/iommu/msm_iommu_dev.c
+++ b/drivers/iommu/msm_iommu_dev.c
@@ -293,20 +293,20 @@ static int msm_iommu_ctx_probe(struct
platform_device *pdev)
int i, ret;
if (!c || !pdev->dev.parent) {
ret = -EINVAL;
- goto fail;
+ goto out;
}
drvdata = dev_get_drvdata(pdev->dev.parent);
if (!drvdata) {
ret = -ENODEV;
- goto fail;
+ goto out;
}
ctx_drvdata = kzalloc(sizeof(*ctx_drvdata), GFP_KERNEL);
if (!ctx_drvdata) {
ret = -ENOMEM;
- goto fail;
+ goto out;
}
ctx_drvdata->num = c->num;
ctx_drvdata->pdev = pdev;
@@ -359,6 +359,7 @@ static int msm_iommu_ctx_probe(struct
platform_device *pdev)
return 0;
fail:
kfree(ctx_drvdata);
+out:
return ret;
}
--
1.8.1.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists