Commit 012dd14d authored by Guchun Chen's avatar Guchun Chen Committed by Alex Deucher

drm/amdgpu: fix ras ctrl debugfs node leak

Use debugfs_remove_recursive to remove the whole debugfs
directory instead of removing the node one by one.
Signed-off-by: default avatarGuchun Chen <guchun.chen@amd.com>
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 1313dacf
...@@ -980,10 +980,10 @@ static void amdgpu_ras_debugfs_create_ctrl_node(struct amdgpu_device *adev) ...@@ -980,10 +980,10 @@ static void amdgpu_ras_debugfs_create_ctrl_node(struct amdgpu_device *adev)
struct drm_minor *minor = adev->ddev->primary; struct drm_minor *minor = adev->ddev->primary;
con->dir = debugfs_create_dir("ras", minor->debugfs_root); con->dir = debugfs_create_dir("ras", minor->debugfs_root);
con->ent = debugfs_create_file("ras_ctrl", S_IWUGO | S_IRUGO, con->dir, debugfs_create_file("ras_ctrl", S_IWUGO | S_IRUGO, con->dir,
adev, &amdgpu_ras_debugfs_ctrl_ops); adev, &amdgpu_ras_debugfs_ctrl_ops);
con->ent = debugfs_create_file("ras_eeprom_reset", S_IWUGO | S_IRUGO, con->dir, debugfs_create_file("ras_eeprom_reset", S_IWUGO | S_IRUGO, con->dir,
adev, &amdgpu_ras_debugfs_eeprom_ops); adev, &amdgpu_ras_debugfs_eeprom_ops);
} }
void amdgpu_ras_debugfs_create(struct amdgpu_device *adev, void amdgpu_ras_debugfs_create(struct amdgpu_device *adev,
...@@ -1028,10 +1028,8 @@ static void amdgpu_ras_debugfs_remove_all(struct amdgpu_device *adev) ...@@ -1028,10 +1028,8 @@ static void amdgpu_ras_debugfs_remove_all(struct amdgpu_device *adev)
amdgpu_ras_debugfs_remove(adev, &obj->head); amdgpu_ras_debugfs_remove(adev, &obj->head);
} }
debugfs_remove(con->ent); debugfs_remove_recursive(con->dir);
debugfs_remove(con->dir);
con->dir = NULL; con->dir = NULL;
con->ent = NULL;
} }
/* debugfs end */ /* debugfs end */
......
...@@ -317,8 +317,6 @@ struct amdgpu_ras { ...@@ -317,8 +317,6 @@ struct amdgpu_ras {
struct list_head head; struct list_head head;
/* debugfs */ /* debugfs */
struct dentry *dir; struct dentry *dir;
/* debugfs ctrl */
struct dentry *ent;
/* sysfs */ /* sysfs */
struct device_attribute features_attr; struct device_attribute features_attr;
struct bin_attribute badpages_attr; struct bin_attribute badpages_attr;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment