public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] EDAC: use debugfs_remove_recursive instead of debugfs_remove
@ 2015-10-13  2:22 Tan Xiaojun
  2015-10-13  7:41 ` Borislav Petkov
  0 siblings, 1 reply; 4+ messages in thread
From: Tan Xiaojun @ 2015-10-13  2:22 UTC (permalink / raw)
  To: dougthompson, bp, mchehab; +Cc: linux-edac, linux-kernel

debugfs_remove is used to remove a file or an empty directory from
the debugfs filesystem, but mci->debugfs is not empty.

This is not easily discovered, because debugfs_remove return nothing
when failed.

Reported-by: Yun Wu (Abel) <wuyun.wu@huawei.com>
Signed-off-by: Tan Xiaojun <tanxiaojun@huawei.com>
---
 drivers/edac/edac_mc_sysfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c
index 33df7d9..292e806 100644
--- a/drivers/edac/edac_mc_sysfs.c
+++ b/drivers/edac/edac_mc_sysfs.c
@@ -956,7 +956,7 @@ static int edac_create_debug_nodes(struct mem_ctl_info *mci)
 	mci->debugfs = parent;
 	return 0;
 nomem:
-	debugfs_remove(mci->debugfs);
+	debugfs_remove_recursive(mci->debugfs);
 	return -ENOMEM;
 }
 #endif
@@ -1070,7 +1070,7 @@ void edac_remove_sysfs_mci_device(struct mem_ctl_info *mci)
 	edac_dbg(0, "\n");
 
 #ifdef CONFIG_EDAC_DEBUG
-	debugfs_remove(mci->debugfs);
+	debugfs_remove_recursive(mci->debugfs);
 #endif
 #ifdef CONFIG_EDAC_LEGACY_SYSFS
 	edac_delete_csrow_objects(mci);
-- 
2.5.3


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-10-13 10:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-13  2:22 [PATCH] EDAC: use debugfs_remove_recursive instead of debugfs_remove Tan Xiaojun
2015-10-13  7:41 ` Borislav Petkov
2015-10-13  8:45   ` Tan Xiaojun
2015-10-13  9:45     ` Borislav Petkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox