[PATCH 1/8] drm: Clean up debugfs upon shutdown

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Driver authors are a forgetful breed, and having to manually clean up
all inodes from debugfs during module unload is tedious and rarely
encountered by users; leftover inodes fester. But behold, the drm core
already tracks all inodes created under the DRI debugfs minor so that we
can do all the teardown ourselves.

Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
Cc: Dave Airlie <airlied@xxxxxxxxxx>
---
 drivers/gpu/drm/drm_debugfs.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c
index a05087c..b855fd7 100644
--- a/drivers/gpu/drm/drm_debugfs.c
+++ b/drivers/gpu/drm/drm_debugfs.c
@@ -229,7 +229,16 @@ int drm_debugfs_cleanup(struct drm_minor *minor)
 	if (dev->driver->debugfs_cleanup)
 		dev->driver->debugfs_cleanup(minor);
 
-	drm_debugfs_remove_files(drm_debugfs_list, DRM_DEBUGFS_ENTRIES, minor);
+	while (!list_empty(&minor->debugfs_list)) {
+		struct drm_info_node *node =
+			list_first_entry(&minor->debugfs_list,
+					 struct drm_info_node,
+					 list);
+
+		debugfs_remove(node->dent);
+		list_del(&node->list);
+		kfree(node);
+	}
 
 	debugfs_remove(minor->debugfs_root);
 	minor->debugfs_root = NULL;
-- 
1.8.3.2

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel



[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux