From 7fd1e38cb46ffc4cbf6f67113790e453d0b4fa0f Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Wed, 19 Jun 2013 10:05:31 +1000 Subject: [PATCH] drivers-iommu-msm_iommu_devc-fix-leak-and-clean-up-error-paths-fix remove now-unneeded initialization of ctx_drvdata, remove unneeded braces Cc: David Brown Cc: David Woodhouse Cc: James Hogan Cc: Libo Chen Cc: Libo Chen Signed-off-by: Andrew Morton --- drivers/iommu/msm_iommu_dev.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/iommu/msm_iommu_dev.c b/drivers/iommu/msm_iommu_dev.c index 63cdeb903d5c..6ba351477132 100644 --- a/drivers/iommu/msm_iommu_dev.c +++ b/drivers/iommu/msm_iommu_dev.c @@ -291,22 +291,19 @@ static int msm_iommu_ctx_probe(struct platform_device *pdev) { struct msm_iommu_ctx_dev *c = pdev->dev.platform_data; struct msm_iommu_drvdata *drvdata; - struct msm_iommu_ctx_drvdata *ctx_drvdata = NULL; + struct msm_iommu_ctx_drvdata *ctx_drvdata; int i, ret; - if (!c || !pdev->dev.parent) { + + if (!c || !pdev->dev.parent) return -EINVAL; - } drvdata = dev_get_drvdata(pdev->dev.parent); - - if (!drvdata) { + if (!drvdata) return -ENODEV; - } ctx_drvdata = kzalloc(sizeof(*ctx_drvdata), GFP_KERNEL); - if (!ctx_drvdata) { + if (!ctx_drvdata) return -ENOMEM; - } ctx_drvdata->num = c->num; ctx_drvdata->pdev = pdev; -- 2.39.5