Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

iommu/omap: fix device leaks on probe_device()

Make sure to drop the references taken to the iommu platform devices
when looking up their driver data during probe_device().

Note that the arch data device pointer added by commit 604629bcb505
("iommu/omap: add support for late attachment of iommu devices") has
never been used. Remove it to underline that the references are not
needed.

Fixes: 9d5018deec86 ("iommu/omap: Add support to program multiple iommus")
Fixes: 7d6827748d54 ("iommu/omap: Fix iommu archdata name for DT-based devices")
Cc: stable@vger.kernel.org # 3.18
Cc: Suman Anna <s-anna@ti.com>
Acked-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>

authored by

Johan Hovold and committed by
Joerg Roedel
b5870691 ab31cf04

+1 -3
+1 -1
drivers/iommu/omap-iommu.c
··· 1675 1675 } 1676 1676 1677 1677 oiommu = platform_get_drvdata(pdev); 1678 + put_device(&pdev->dev); 1678 1679 if (!oiommu) { 1679 1680 of_node_put(np); 1680 1681 kfree(arch_data); ··· 1683 1682 } 1684 1683 1685 1684 tmp->iommu_dev = oiommu; 1686 - tmp->dev = &pdev->dev; 1687 1685 1688 1686 of_node_put(np); 1689 1687 }
-2
drivers/iommu/omap-iommu.h
··· 88 88 /** 89 89 * struct omap_iommu_arch_data - omap iommu private data 90 90 * @iommu_dev: handle of the OMAP iommu device 91 - * @dev: handle of the iommu device 92 91 * 93 92 * This is an omap iommu private data object, which binds an iommu user 94 93 * to its iommu device. This object should be placed at the iommu user's ··· 96 97 */ 97 98 struct omap_iommu_arch_data { 98 99 struct omap_iommu *iommu_dev; 99 - struct device *dev; 100 100 }; 101 101 102 102 struct cr_regs {