[2/8] Staging: batman-adv: Ignore debugfs on kernels without debugfs support

Message ID 1276908713-28365-3-git-send-email-sven.eckelmann@gmx.de (mailing list archive)
State Not Applicable, archived
Headers

Commit Message

Sven Eckelmann June 19, 2010, 12:51 a.m. UTC
  All code for debugfs is ignored when the creation of the batman-adv root
directory in debugfs fails. It must also be ignored when the
debugfs_create_dir tells us that debugfs is not implemented to prevent
possible crashes in the future.

Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
---
 drivers/staging/batman-adv/bat_debugfs.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
  

Patch

diff --git a/drivers/staging/batman-adv/bat_debugfs.c b/drivers/staging/batman-adv/bat_debugfs.c
index a8fe1c9..fafca9f 100644
--- a/drivers/staging/batman-adv/bat_debugfs.c
+++ b/drivers/staging/batman-adv/bat_debugfs.c
@@ -88,6 +88,8 @@  static struct bat_debuginfo *mesh_debuginfos[] = {
 void debugfs_init(void)
 {
 	bat_debugfs = debugfs_create_dir(DEBUGFS_BAT_SUBDIR, NULL);
+	if (bat_debugfs == ERR_PTR(-ENODEV))
+		bat_debugfs = NULL;
 }
 
 void debugfs_destroy(void)