From: Sven Eckelmann Date: Mon, 21 Jun 2010 23:25:48 +0000 (+0200) Subject: Staging: batman-adv: Ignore debugfs on kernels without debugfs support X-Git-Tag: v2.6.36-rc1~520^2~1^2~392 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=8bfe3638747b2c2f842edf9eb2a407a22a9d537d;p=linux.git Staging: batman-adv: Ignore debugfs on kernels without debugfs support 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/batman-adv/bat_debugfs.c b/drivers/staging/batman-adv/bat_debugfs.c index a8fe1c91fa4c..fafca9f0a33c 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)