msm: iommu: no need kfree before kzalloc successful
Subsystems (3)
PATCH 2/2 msm: iommu: no need kfree before kzalloc successful
From: [email protected]
We don`t need to kfree drvdata before kzalloc successful
Signed-off-by Libo Chen <[email protected]>
--- drivers/iommu/msm_iommu_dev.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/iommu/msm_iommu_dev.c +0 -0
@@ -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;
}
Signature · 1 line
1.8.1.2