]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/pagemap_util: Ensure proper cache lock management on free
authorJonathan Cavitt <jonathan.cavitt@intel.com>
Mon, 16 Mar 2026 15:15:56 +0000 (15:15 +0000)
committerThomas Hellström <thomas.hellstrom@linux.intel.com>
Tue, 17 Mar 2026 14:39:07 +0000 (15:39 +0100)
commit67253b28a61f0dff31f8f00dca8c9586f089b852
tree670a91b9e2767d6a9db7516038eb8f94be9947f0
parent74ef7844dd8c27d6b94ebc102bb4677edd3e7696
drm/pagemap_util: Ensure proper cache lock management on free

For the sake of consistency, ensure that the cache lock is always
unlocked after drm_pagemap_cache_fini. Spinlocks typically disable
preemption and if the code-path missing the unlock is hit, preemption
will remain disabled even if the lock is subsequently freed.

Fixes static analysis issue.

v2:
- Use requested code flow (Maarten)

v3:
- Clear cache->dpagemap (Matt Brost, Maarten)

v4:
- Reword commit message (Thomas)

Fixes: 77f14f2f2d73f ("drm/pagemap: Add a drm_pagemap cache and shrinker")
Signed-off-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Thomas Hellstrom <thomas.hellstrom@linux.intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Link: https://patch.msgid.link/20260316151555.7553-2-jonathan.cavitt@intel.com
drivers/gpu/drm/drm_pagemap_util.c