From: David Herrmann Date: Sun, 20 Oct 2013 16:55:43 +0000 (+0200) Subject: drm: cleanup debugfs in drm_unplug_minor() X-Git-Tag: v3.13-rc1~69^2~22 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=865fb47f7f9aa1a1be2ce6a1d37af98f8d4a0d04;p=kernel%2Fkernel-generic.git drm: cleanup debugfs in drm_unplug_minor() There is no reason to delay debugfs-cleanup to drm_put_minor(). We should forbid any access to debugfs files once the device is dead. Chances they oops once a card was unplugged are very high, anyway. Signed-off-by: David Herrmann Signed-off-by: Dave Airlie --- diff --git a/drivers/gpu/drm/drm_stub.c b/drivers/gpu/drm/drm_stub.c index 76b4d71..b37b0d9 100644 --- a/drivers/gpu/drm/drm_stub.c +++ b/drivers/gpu/drm/drm_stub.c @@ -341,6 +341,10 @@ static void drm_unplug_minor(struct drm_minor *minor) if (!minor || !device_is_registered(minor->kdev)) return; +#if defined(CONFIG_DEBUG_FS) + drm_debugfs_cleanup(minor); +#endif + drm_sysfs_device_remove(minor); } @@ -360,10 +364,6 @@ static void drm_put_minor(struct drm_minor *minor) DRM_DEBUG("release secondary minor %d\n", minor->index); -#if defined(CONFIG_DEBUG_FS) - drm_debugfs_cleanup(minor); -#endif - drm_unplug_minor(minor); idr_remove(&drm_minors_idr, minor->index);