Skip to content

Commit

Permalink
lib: dynamic_debug: no need to check return value of debugfs_create f…
Browse files Browse the repository at this point in the history
…unctions

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>
  • Loading branch information
Greg Kroah-Hartman committed Jun 18, 2019
1 parent 4a14abc commit 9fd714c
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions lib/dynamic_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -993,20 +993,14 @@ static __initdata int ddebug_init_success;

static int __init dynamic_debug_init_debugfs(void)
{
struct dentry *dir, *file;
struct dentry *dir;

if (!ddebug_init_success)
return -ENODEV;

dir = debugfs_create_dir("dynamic_debug", NULL);
if (!dir)
return -ENOMEM;
file = debugfs_create_file("control", 0644, dir, NULL,
&ddebug_proc_fops);
if (!file) {
debugfs_remove(dir);
return -ENOMEM;
}
debugfs_create_file("control", 0644, dir, NULL, &ddebug_proc_fops);

return 0;
}

Expand Down

0 comments on commit 9fd714c

Please sign in to comment.