Subject: [merged] drivers-iommu-msm_iommu_devc-fix-leak-and-clean-up-error-paths.patch removed from -mm tree To: clbchenlibo.chen@xxxxxxxxxx,davidb@xxxxxxxxxxxxxx,dwmw2@xxxxxxxxxxxxx,james.hogan@xxxxxxxxxx,libo.chen@xxxxxxxxxx,mm-commits@xxxxxxxxxxxxxxx From: akpm@xxxxxxxxxxxxxxxxxxxx Date: Tue, 09 Jul 2013 16:19:20 -0700 The patch titled Subject: drivers/iommu/msm_iommu_dev.c: fix leak and clean up error paths has been removed from the -mm tree. Its filename was drivers-iommu-msm_iommu_devc-fix-leak-and-clean-up-error-paths.patch This patch was dropped because it was merged into mainline or a subsystem tree ------------------------------------------------------ From: Libo Chen <clbchenlibo.chen@xxxxxxxxxx> Subject: drivers/iommu/msm_iommu_dev.c: fix leak and clean up error paths Fix two obvious problems: 1. We have registered msm_iommu_driver first, and need unregister it when registered msm_iommu_ctx_driver fail 2. We don't need to kfree drvdata before kzalloc was successful. [akpm@xxxxxxxxxxxxxxxxxxxx: remove now-unneeded initialization of ctx_drvdata, remove unneeded braces] Signed-off-by: Libo Chen <libo.chen@xxxxxxxxxx> Acked-by: David Brown <davidb@xxxxxxxxxxxxxx> Cc: David Woodhouse <dwmw2@xxxxxxxxxxxxx> Cc: James Hogan <james.hogan@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- drivers/iommu/msm_iommu_dev.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff -puN drivers/iommu/msm_iommu_dev.c~drivers-iommu-msm_iommu_devc-fix-leak-and-clean-up-error-paths drivers/iommu/msm_iommu_dev.c --- a/drivers/iommu/msm_iommu_dev.c~drivers-iommu-msm_iommu_devc-fix-leak-and-clean-up-error-paths +++ a/drivers/iommu/msm_iommu_dev.c @@ -291,25 +291,20 @@ static int msm_iommu_ctx_probe(struct pl { 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) { - ret = -EINVAL; - goto fail; - } - drvdata = dev_get_drvdata(pdev->dev.parent); + if (!c || !pdev->dev.parent) + return -EINVAL; - if (!drvdata) { - ret = -ENODEV; - goto fail; - } + drvdata = dev_get_drvdata(pdev->dev.parent); + if (!drvdata) + return -ENODEV; ctx_drvdata = kzalloc(sizeof(*ctx_drvdata), GFP_KERNEL); - if (!ctx_drvdata) { - ret = -ENOMEM; - goto fail; - } + if (!ctx_drvdata) + return -ENOMEM; + ctx_drvdata->num = c->num; ctx_drvdata->pdev = pdev; @@ -403,6 +398,7 @@ static int __init msm_iommu_driver_init( ret = platform_driver_register(&msm_iommu_ctx_driver); if (ret != 0) { + platform_driver_unregister(&msm_iommu_driver); pr_err("Failed to register IOMMU context driver\n"); goto error; } _ Patches currently in -mm which might be from clbchenlibo.chen@xxxxxxxxxx are origin.patch linux-next.patch drivers-ide-delkin_cb-convert-to-module_pci_driver.patch drivers-atm-he-convert-to-module_pci_driver.patch drivers-scsi-a100u2w-convert-to-module_pci_driver.patch drivers-scsi-dc395x-convert-to-module_pci_driver.patch drivers-scsi-dmx3191d-convert-to-module_pci_driver.patch drivers-scsi-initio-convert-to-module_pci_driver.patch drivers-scsi-mvumi-convert-to-module_pci_driver.patch drivers-net-irda-donauboe-convert-to-module_pci_driver.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html