batman-adv: Ignore debugfs on kernels without debugfs support

Message ID 1276123156-12293-1-git-send-email-sven.eckelmann@gmx.de (mailing list archive)
State Accepted, archived
Headers

Commit Message

Sven Eckelmann June 9, 2010, 10:39 p.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 a
crash during the unload of the module.

Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
---
 Must be applied in both maint and trunk.

 batman-adv-kernelland/bat_debugfs.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
  

Comments

Marek Lindner June 10, 2010, 8:05 a.m. UTC | #1
On Thursday 10 June 2010 06:39:16 Sven Eckelmann wrote:
> 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 a
> crash during the unload of the module.

Applied in revision 1698.

Thanks,
Marek
  

Patch

diff --git a/batman-adv-kernelland/bat_debugfs.c b/batman-adv-kernelland/bat_debugfs.c
index cf2545a..b8081e3 100644
--- a/batman-adv-kernelland/bat_debugfs.c
+++ b/batman-adv-kernelland/bat_debugfs.c
@@ -101,6 +101,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)