]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/panthor: Check debugfs GEM lock initialization
authorLinmao Li <lilinmao@kylinos.cn>
Mon, 13 Jul 2026 08:29:12 +0000 (16:29 +0800)
committerLiviu Dudau <liviu.dudau@arm.com>
Wed, 15 Jul 2026 12:22:25 +0000 (13:22 +0100)
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: a3707f53eb3f ("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>
drivers/gpu/drm/panthor/panthor_device.c

index 0b25abebb803c6a016ce85a80469f9e8124a324d..9687c59de35055eb93ed1014a8061526a94aa63a 100644 (file)
@@ -182,7 +182,10 @@ int panthor_device_init(struct panthor_device *ptdev)
                return ret;
 
 #ifdef CONFIG_DEBUG_FS
-       drmm_mutex_init(&ptdev->base, &ptdev->gems.lock);
+       ret = drmm_mutex_init(&ptdev->base, &ptdev->gems.lock);
+       if (ret)
+               return ret;
+
        INIT_LIST_HEAD(&ptdev->gems.node);
 #endif