Skip to content

Commit 9fd714c

Browse files
committed
lib: dynamic_debug: no need to check return value of debugfs_create functions
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. Cc: linux-kernel@vger.kernel.org Acked-by: Jason Baron <jbaron@akamai.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 4a14abc commit 9fd714c

1 file changed

Lines changed: 3 additions & 9 deletions

File tree

‎lib/dynamic_debug.c‎

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -993,20 +993,14 @@ static __initdata int ddebug_init_success;
993993

994994
static int __init dynamic_debug_init_debugfs(void)
995995
{
996-
struct dentry *dir, *file;
996+
struct dentry *dir;
997997

998998
if (!ddebug_init_success)
999999
return -ENODEV;
10001000

10011001
dir = debugfs_create_dir("dynamic_debug", NULL);
1002-
if (!dir)
1003-
return -ENOMEM;
1004-
file = debugfs_create_file("control", 0644, dir, NULL,
1005-
&ddebug_proc_fops);
1006-
if (!file) {
1007-
debugfs_remove(dir);
1008-
return -ENOMEM;
1009-
}
1002+
debugfs_create_file("control", 0644, dir, NULL, &ddebug_proc_fops);
1003+
10101004
return 0;
10111005
}
10121006

0 commit comments

Comments
 (0)