Skip to content

Commit

Permalink
mm: kmemleak: no need to check return value of debugfs_create functions
Browse files Browse the repository at this point in the history
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: Catalin Marinas <[email protected]>
Cc: [email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
gregkh committed Jun 3, 2019
1 parent 4268509 commit 282401d
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions mm/kmemleak.c
Original file line number Diff line number Diff line change
Expand Up @@ -2118,14 +2118,9 @@ void __init kmemleak_init(void)
*/
static int __init kmemleak_late_init(void)
{
struct dentry *dentry;

kmemleak_initialized = 1;

dentry = debugfs_create_file("kmemleak", 0644, NULL, NULL,
&kmemleak_fops);
if (!dentry)
pr_warn("Failed to create the debugfs kmemleak file\n");
debugfs_create_file("kmemleak", 0644, NULL, NULL, &kmemleak_fops);

if (kmemleak_error) {
/*
Expand Down

0 comments on commit 282401d

Please sign in to comment.