Skip to content

Commit 022e901

Browse files
Linmao Lidliviu
authored andcommitted
drm/panthor: Check debugfs GEM lock initialization
drmm_mutex_init() can fail while registering the managed cleanup action. When that happens, drmm_add_action_or_reset() destroys the mutex before returning the error. Continuing initialization would therefore leave the debugfs GEM object list with an unusable lock. Propagate the error as is already done for the other managed mutexes in panthor_device_init(). Fixes: a3707f5 ("drm/panthor: show device-wide list of DRM GEM objects over DebugFS") Signed-off-by: Linmao Li <lilinmao@kylinos.cn> Reviewed-by: Liviu Dudau <liviu.dudau@arm.com> Link: https://patch.msgid.link/20260713082912.321021-1-lilinmao@kylinos.cn Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
1 parent 4a2c8cb commit 022e901

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

drivers/gpu/drm/panthor/panthor_device.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,10 @@ int panthor_device_init(struct panthor_device *ptdev)
182182
return ret;
183183

184184
#ifdef CONFIG_DEBUG_FS
185-
drmm_mutex_init(&ptdev->base, &ptdev->gems.lock);
185+
ret = drmm_mutex_init(&ptdev->base, &ptdev->gems.lock);
186+
if (ret)
187+
return ret;
188+
186189
INIT_LIST_HEAD(&ptdev->gems.node);
187190
#endif
188191

0 commit comments

Comments
 (0)