mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-31 22:34:33 +01:00
EDAC: Use edac_debugfs_remove_recursive()
debugfs_remove() is used to remove a file or a directory from the debugfs filesystem, but mci->debugfs might not empty. This can be triggered by the following sequence: 1) Enable CONFIG_EDAC_DEBUG 2) insmod an EDAC module (like i3000_edac or similar) 3) rmmod this module 4) we can see files remaining under <debugfs_mountpoint>/edac/ like "fake_inject", for example. Removing edac_core then, causes a NULL pointer dereference. Reported-by: Yun Wu (Abel) <[email protected]> Signed-off-by: Tan Xiaojun <[email protected]> Cc: Doug Thompson <[email protected]> Cc: Mauro Carvalho Chehab <[email protected]> Cc: linux-edac <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Borislav Petkov <[email protected]>
This commit is contained in:
1 parent
90b3b37383
commit
30f84a891b
2 files changed
+2
-2
No files matched your search
@@ -98,7 +98,7 @@ int edac_create_debugfs_nodes(struct mem_ctl_info *mci)
|
||||
mci->debugfs = parent;
|
||||
return 0;
|
||||
nomem:
|
||||
debugfs_remove(mci->debugfs);
|
||||
edac_debugfs_remove_recursive(mci->debugfs);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
|
||||
@@ -976,7 +976,7 @@ void edac_remove_sysfs_mci_device(struct mem_ctl_info *mci)
|
||||
edac_dbg(0, "\n");
|
||||
|
||||
#ifdef CONFIG_EDAC_DEBUG
|
||||
debugfs_remove(mci->debugfs);
|
||||
edac_debugfs_remove_recursive(mci->debugfs);
|
||||
#endif
|
||||
#ifdef CONFIG_EDAC_LEGACY_SYSFS
|
||||
edac_delete_csrow_objects(mci);
|
||||
|
||||
Reference in new issue
Block a user