Skip to content
Snippets Groups Projects
Commit fecb0d95 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman Committed by Thomas Gleixner
Browse files

debugobjects: No need to check return value of debugfs_create()


When calling debugfs functions, there is no need to ever check the
return value.  The function can work or not, but the code logic should
never do something different based on this.

Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Cc: Qian Cai <cai@gmx.us>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Waiman Long <longman@redhat.com>
Cc: "Joel Fernandes (Google)" <joel@joelfernandes.org>
Cc: Zhong Jiang <zhongjiang@huawei.com>
Link: https://lkml.kernel.org/r/20190612153513.GA21082@kroah.com
parent d1fdb6d8
No related branches found
No related tags found
No related merge requests found
......@@ -850,26 +850,16 @@ static const struct file_operations debug_stats_fops = {
static int __init debug_objects_init_debugfs(void)
{
struct dentry *dbgdir, *dbgstats;
struct dentry *dbgdir;
if (!debug_objects_enabled)
return 0;
dbgdir = debugfs_create_dir("debug_objects", NULL);
if (!dbgdir)
return -ENOMEM;
dbgstats = debugfs_create_file("stats", 0444, dbgdir, NULL,
&debug_stats_fops);
if (!dbgstats)
goto err;
debugfs_create_file("stats", 0444, dbgdir, NULL, &debug_stats_fops);
return 0;
err:
debugfs_remove(dbgdir);
return -ENOMEM;
}
__initcall(debug_objects_init_debugfs);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment