From patchwork Wed Jun 9 22:39:16 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 222 Return-Path: Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by open-mesh.net (Postfix) with SMTP id AEFE91542A7 for ; Thu, 10 Jun 2010 00:39:21 +0200 (CEST) Received: (qmail invoked by alias); 09 Jun 2010 22:39:20 -0000 Received: from i59F6A2E8.versanet.de (EHLO sven-desktop.lazhur.ath.cx) [89.246.162.232] by mail.gmx.net (mp022) with SMTP; 10 Jun 2010 00:39:20 +0200 X-Authenticated: #15668376 X-Provags-ID: V01U2FsdGVkX1/OkxBM19DOA5ymUiXu2mW3LjgnOdKqjuq1rd2nmA qnOiLfjwmw5Dry From: Sven Eckelmann To: b.a.t.m.a.n@lists.open-mesh.org Date: Thu, 10 Jun 2010 00:39:16 +0200 Message-Id: <1276123156-12293-1-git-send-email-sven.eckelmann@gmx.de> X-Mailer: git-send-email 1.7.1 X-Y-GMX-Trusted: 0 Subject: [B.A.T.M.A.N.] [PATCH] batman-adv: Ignore debugfs on kernels without debugfs support X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.11 Precedence: list Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2010 22:39:22 -0000 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 --- Must be applied in both maint and trunk. batman-adv-kernelland/bat_debugfs.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) 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)