lkml.org 
[lkml]   [2015]   [Nov]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] mmc: add ifdef around fault_create_debugfs_attr()
Date
FAIL_MMC_REQUEST can be used without FAULT_INJECTION_DEBUG_FS.
In this case fault_create_debugfs_attr() will always return an error and
lead to the deletion of the whole debugfs directory.

This patch makes sure that FAULT_INJECTION_DEBUG_FS is enabled before
attempting to create the debugfs atttribute.

Signed-off-by: Adrien Schildknecht <adrien+dev@schischi.me>
---
drivers/mmc/core/debugfs.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/mmc/core/debugfs.c b/drivers/mmc/core/debugfs.c
index 154aced..13e842c 100644
--- a/drivers/mmc/core/debugfs.c
+++ b/drivers/mmc/core/debugfs.c
@@ -259,11 +259,13 @@ void mmc_add_host_debugfs(struct mmc_host *host)
if (fail_request)
setup_fault_attr(&fail_default_attr, fail_request);
host->fail_mmc_request = fail_default_attr;
+#ifdef CONFIG_FAULT_INJECTION_DEBUG_FS
if (IS_ERR(fault_create_debugfs_attr("fail_mmc_request",
root,
&host->fail_mmc_request)))
goto err_node;
#endif
+#endif
return;

err_node:
--
2.6.2


\
 
 \ /
  Last update: 2015-11-06 13:41    [W:0.044 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site