Commit 3b5220a0 authored by Daniel Mentz's avatar Daniel Mentz Committed by Isaac Manjarres
Browse files

ANDROID: iommu/arm-smmu-v3: Handle NULL gather in arm_smmu_tlb_inv_page_nosync



Commit be9ba86c ("ANDROID: iommu/io-pgtable: Always call
io_pgtable_tlb_add_page even if gather is NULL") modified the core
io-pgtable logic to always call the .tlb_add_page callback, even when
the iotlb_gather object is NULL.

The Arm SMMUv3 implementation of this callback,
arm_smmu_tlb_inv_page_nosync(), did not anticipate this change. It
passes the 'gather' pointer directly to iommu_iotlb_gather_add_page(),
which will dereference it, leading to a NULL pointer dereference when
'gather' is NULL.

Fix this by adding a check to ensure 'gather' is not NULL before calling
iommu_iotlb_gather_add_page().

Bug: 450108340
Fixes: be9ba86c ("ANDROID: iommu/io-pgtable: Always call io_pgtable_tlb_add_page even if gather is NULL")
Change-Id: I8143cf71939c470b812c94307f956b8c6b6e4996
Signed-off-by: default avatarDaniel Mentz <danielmentz@google.com>
parent cd52fcbd
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment