diff mbox

[4/6] drm: cleanup debugfs in drm_unplug_minor()

Message ID 1382288145-1776-4-git-send-email-dh.herrmann@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

David Herrmann Oct. 20, 2013, 4:55 p.m. UTC
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 <dh.herrmann@gmail.com>
---
 drivers/gpu/drm/drm_stub.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff mbox

Patch

diff --git a/drivers/gpu/drm/drm_stub.c b/drivers/gpu/drm/drm_stub.c
index 7feed52..5bf4339 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);