Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit a257e81

Browse files
committed
drm/panthor: Reset the FW VM to NULL on unplug
This way get NULL derefs instead of use-after-free if the FW VM is referenced after the device has been unplugged. Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Steven Price <steven.price@arm.com> Acked-by: Liviu Dudau <liviu.dudau@arm.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240502183813.1612017-4-boris.brezillon@collabora.com
1 parent ff60c8d commit a257e81

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/gpu/drm/panthor/panthor_fw.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1142,6 +1142,7 @@ void panthor_fw_unplug(struct panthor_device *ptdev)
11421142
* state to keep the active_refcnt balanced.
11431143
*/
11441144
panthor_vm_put(ptdev->fw->vm);
1145+
ptdev->fw->vm = NULL;
11451146

11461147
panthor_gpu_power_off(ptdev, L2, ptdev->gpu_info.l2_present, 20000);
11471148
}

0 commit comments

Comments
 (0)