iommu/exynos: Remove initconst attribute to avoid potential kernel oops
authorMarek Szyprowski <m.szyprowski@samsung.com>
Mon, 9 Oct 2017 11:40:23 +0000 (13:40 +0200)
committerBen Hutchings <ben@decadent.org.uk>
Mon, 1 Jan 2018 20:51:51 +0000 (20:51 +0000)
commit 9d25e3cc83d731ae4eeb017fd07562fde3f80bef upstream.

Exynos SYSMMU registers standard platform device with sysmmu_of_match
table, what means that this table is accessed every time a new platform
device is registered in a system. This might happen also after the boot,
so the table must not be attributed as initconst to avoid potential kernel
oops caused by access to freed memory.

Fixes: 6b21a5db3642 ("iommu/exynos: Support for device tree")
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/iommu/exynos-iommu.c

index 99054d2c040d6e2c3b20f85e4e1e5c5c36682fa5..e7434b1b1d626ac7271430653acda52e7a578abe 100644 (file)
@@ -676,7 +676,7 @@ static int __init exynos_sysmmu_probe(struct platform_device *pdev)
        return 0;
 }
 
-static const struct of_device_id sysmmu_of_match[] __initconst = {
+static const struct of_device_id sysmmu_of_match[] = {
        { .compatible   = "samsung,exynos-sysmmu", },
        { },
 };