summaryrefslogtreecommitdiffstats
path: root/lib/debugobjects.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-06-12 11:35:13 -0400
committerThomas Gleixner <tglx@linutronix.de>2019-06-14 08:51:14 -0400
commitfecb0d95cdf752836cafdfffc1661f61ba4e2101 (patch)
treeccb07b0f504546801a1e75196f1fc1d1cef5fa1a /lib/debugobjects.c
parentd1fdb6d8f6a4109a4263176c84b899076a5f8008 (diff)
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Thomas 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
Diffstat (limited to 'lib/debugobjects.c')
-rw-r--r--lib/debugobjects.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/lib/debugobjects.c b/lib/debugobjects.c
index 55437fd5128b..2ac42286cd08 100644
--- a/lib/debugobjects.c
+++ b/lib/debugobjects.c
@@ -850,26 +850,16 @@ static const struct file_operations debug_stats_fops = {
850 850
851static int __init debug_objects_init_debugfs(void) 851static int __init debug_objects_init_debugfs(void)
852{ 852{
853 struct dentry *dbgdir, *dbgstats; 853 struct dentry *dbgdir;
854 854
855 if (!debug_objects_enabled) 855 if (!debug_objects_enabled)
856 return 0; 856 return 0;
857 857
858 dbgdir = debugfs_create_dir("debug_objects", NULL); 858 dbgdir = debugfs_create_dir("debug_objects", NULL);
859 if (!dbgdir)
860 return -ENOMEM;
861 859
862 dbgstats = debugfs_create_file("stats", 0444, dbgdir, NULL, 860 debugfs_create_file("stats", 0444, dbgdir, NULL, &debug_stats_fops);
863 &debug_stats_fops);
864 if (!dbgstats)
865 goto err;
866 861
867 return 0; 862 return 0;
868
869err:
870 debugfs_remove(dbgdir);
871
872 return -ENOMEM;
873} 863}
874__initcall(debug_objects_init_debugfs); 864__initcall(debug_objects_init_debugfs);
875 865