[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1440489154-3470-1-git-send-email-kuleshovmail@gmail.com>
Date: Tue, 25 Aug 2015 13:52:34 +0600
From: Alexander Kuleshov <kuleshovmail@...il.com>
To: Andrew Morton <akpm@...ux-foundation.org>,
Joonsoo Kim <js1304@...il.com>,
Michal Nazarewicz <mina86@...a86.com>,
Sasha Levin <sasha.levin@...cle.com>,
Stefan Strogin <stefan.strogin@...il.com>,
Dmitry Safonov <d.safonov@...tner.samsung.com>
Cc: linux-mm@...ck.org, linux-kernel@...r.kernel.org,
Alexander Kuleshov <kuleshovmail@...il.com>
Subject: [PATCH] mm/cma_debug: Check return value of the debugfs_create_dir()
The debugfs_create_dir() function may fail and return error. If the
root directory not created, we can't create anything inside it. This
patch adds check for this case.
Signed-off-by: Alexander Kuleshov <kuleshovmail@...il.com>
---
mm/cma_debug.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/mm/cma_debug.c b/mm/cma_debug.c
index f8e4b60..bfb46e2 100644
--- a/mm/cma_debug.c
+++ b/mm/cma_debug.c
@@ -171,6 +171,9 @@ static void cma_debugfs_add_one(struct cma *cma, int idx)
tmp = debugfs_create_dir(name, cma_debugfs_root);
+ if (!tmp)
+ return;
+
debugfs_create_file("alloc", S_IWUSR, tmp, cma,
&cma_alloc_fops);
--
2.5.0
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists