Skip to content

Commit

Permalink
x86/RAS/mce_amd_inj: Remove debugfs dir recursively on exit
Browse files Browse the repository at this point in the history
Simplify exit_mce_inject() by using debugfs_remove_recursive() and do
away with the noodling over the dentry elements.

Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20160926083152.30848-3-bp@alien8.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
  • Loading branch information
Borislav Petkov authored and Ingo Molnar committed Sep 26, 2016
1 parent 8b44f00 commit b199ac6
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions arch/x86/ras/mce_amd_inj.c
Original file line number Diff line number Diff line change
Expand Up @@ -475,15 +475,11 @@ static int __init init_mce_inject(void)

static void __exit exit_mce_inject(void)
{
int i;

for (i = 0; i < ARRAY_SIZE(dfs_fls); i++)
debugfs_remove(dfs_fls[i].d);
debugfs_remove_recursive(dfs_inj);
dfs_inj = NULL;

memset(&dfs_fls, 0, sizeof(dfs_fls));

debugfs_remove(dfs_inj);
dfs_inj = NULL;
}
module_init(init_mce_inject);
module_exit(exit_mce_inject);
Expand Down

0 comments on commit b199ac6

Please sign in to comment.