]> git.baikalelectronics.ru Git - kernel.git/commit
iommu/arm-smmu-v3: Don't free page table ops twice
authorJean-Philippe Brucker <jean-philippe.brucker@arm.com>
Thu, 14 Dec 2017 11:03:01 +0000 (11:03 +0000)
committerWill Deacon <will.deacon@arm.com>
Tue, 2 Jan 2018 16:45:45 +0000 (16:45 +0000)
commita294d62a90b53f77156d9b5dc0f63369681e5e59
treefa8a71f06bc09e1943cdba7be57c74687868a8b4
parent6ebfdc2edb3a84fa6b52ee806b0bc6b765b33b3e
iommu/arm-smmu-v3: Don't free page table ops twice

Kasan reports a double free when finalise_stage_fn fails: the io_pgtable
ops are freed by arm_smmu_domain_finalise and then again by
arm_smmu_domain_free. Prevent this by leaving pgtbl_ops empty on failure.

Cc: <stable@vger.kernel.org>
Fixes: b726dae4166c ("iommu/arm-smmu: Add initial driver support for ARM SMMUv3 devices")
Reviewed-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
drivers/iommu/arm-smmu-v3.c