From patchwork Sat Jun 19 00:51:47 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 235 Return-Path: Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by open-mesh.net (Postfix) with SMTP id 4BA041543FD for ; Sat, 19 Jun 2010 02:52:14 +0200 (CEST) Received: (qmail invoked by alias); 19 Jun 2010 00:52:14 -0000 Received: from unknown (EHLO sven-desktop.lazhur.ath.cx) [89.246.195.155] by mail.gmx.net (mp043) with SMTP; 19 Jun 2010 02:52:14 +0200 X-Authenticated: #15668376 X-Provags-ID: V01U2FsdGVkX1/gWqBzNVrgNkVpa7YpfJsz3ykUeihQiU8yVTy+Mi V+e63aDQMIoiES From: Sven Eckelmann To: Greg KH Date: Sat, 19 Jun 2010 02:51:47 +0200 Message-Id: <1276908713-28365-3-git-send-email-sven.eckelmann@gmx.de> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1276908713-28365-1-git-send-email-sven.eckelmann@gmx.de> References: <1276908713-28365-1-git-send-email-sven.eckelmann@gmx.de> X-Y-GMX-Trusted: 0 Cc: b.a.t.m.a.n@lists.open-mesh.net Subject: [B.A.T.M.A.N.] [PATCH 2/8] Staging: 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: Sat, 19 Jun 2010 00:52:14 -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 possible crashes in the future. Signed-off-by: Sven Eckelmann --- drivers/staging/batman-adv/bat_debugfs.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) 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)