summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/msm/msm_iommu.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2025-11-21 08:55:08 +1000
committerDave Airlie <airlied@redhat.com>2025-11-21 08:55:08 +1000
commitce0478b02ed29465c1de3d03c3eea721355f9d2d (patch)
tree79a94d382aa793b762cd974f97fdfa575f603639 /drivers/gpu/drm/msm/msm_iommu.c
parentf0ded972d37150f9f889de75c9eecc5cb0730013 (diff)
parent6a23ae0a96a600d1d12557add110e0bb6e32730c (diff)
Merge tag 'v6.18-rc6' into drm-next
Linux 6.18-rc6 Backmerge in order to merge msm next Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/msm/msm_iommu.c')
-rw-r--r--drivers/gpu/drm/msm/msm_iommu.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpu/drm/msm/msm_iommu.c b/drivers/gpu/drm/msm/msm_iommu.c
index 0e18619f96cb..a188617653e8 100644
--- a/drivers/gpu/drm/msm/msm_iommu.c
+++ b/drivers/gpu/drm/msm/msm_iommu.c
@@ -338,6 +338,8 @@ msm_iommu_pagetable_prealloc_allocate(struct msm_mmu *mmu, struct msm_mmu_preall
ret = kmem_cache_alloc_bulk(pt_cache, GFP_KERNEL, p->count, p->pages);
if (ret != p->count) {
+ kfree(p->pages);
+ p->pages = NULL;
p->count = ret;
return -ENOMEM;
}
@@ -351,6 +353,9 @@ msm_iommu_pagetable_prealloc_cleanup(struct msm_mmu *mmu, struct msm_mmu_preallo
struct kmem_cache *pt_cache = get_pt_cache(mmu);
uint32_t remaining_pt_count = p->count - p->ptr;
+ if (!p->pages)
+ return;
+
if (p->count > 0)
trace_msm_mmu_prealloc_cleanup(p->count, remaining_pt_count);