]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
Staging: batman-adv: Ignore debugfs on kernels without debugfs support
authorSven Eckelmann <sven.eckelmann@gmx.de>
Mon, 21 Jun 2010 23:25:48 +0000 (01:25 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 22 Jun 2010 21:05:05 +0000 (14:05 -0700)
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/batman-adv/bat_debugfs.c

index a8fe1c91fa4c0e454bfdc8932f3596a2956b8cb5..fafca9f0a33c44ae5ee4c7b68a318fcaab5beb1e 100644 (file)
@@ -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)