]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/panfrost: Fix a page leak in panfrost_mmu_map_fault_addr() when THP is on
authorBoris Brezillon <boris.brezillon@collabora.com>
Thu, 8 Jan 2026 12:33:25 +0000 (13:33 +0100)
committerAdrián Larumbe <adrian.larumbe@collabora.com>
Fri, 9 Jan 2026 16:29:30 +0000 (16:29 +0000)
commitb49c35ba0ce1ce1779a2ad563c85fbf87d03689f
treec34efbedd798731d14fcf686b0d5c9924f3eb624
parent29f4e7301910d7d1ece249cf34dfbe4dd7c2c6c4
drm/panfrost: Fix a page leak in panfrost_mmu_map_fault_addr() when THP is on

drm_gem_put_pages(), which we rely on for returning BO pages to shmem,
assume per-folio refcounting and not per-page. If we call
shmem_read_mapping_page() per-page, we break this assumption and leak
pages every time we get a huge page allocated.

v2:
- Rework the logic for() loop to better match the folio-granular
  allocation scheme

Cc: Loïc Molinari <loic.molinari@collabora.com>
Fixes: c12e9fcb5a5a ("drm/panfrost: Introduce huge tmpfs mountpoint option")
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Adrián Larumbe <adrian.larumbe@collabora.com>
Reviewed-by: Steven Price <steven.price@arm.com>
Link: https://patch.msgid.link/20260108123325.1088195-1-boris.brezillon@collabora.com
Signed-off-by: Adrián Larumbe <adrian.larumbe@collabora.com>
drivers/gpu/drm/panfrost/panfrost_mmu.c