From: Andrew Morton Date: Wed, 19 Jun 2013 00:05:31 +0000 (+1000) Subject: drivers-iommu-msm_iommu_devc-fix-leak-and-clean-up-error-paths-fix X-Git-Tag: next-20130619~2^2~623 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=7fd1e38cb46ffc4cbf6f67113790e453d0b4fa0f;p=karo-tx-linux.git 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 --- 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;