Skip to content

Commit a4abeb0

Browse files
gregkhjfvogel
authored andcommitted
kcov: 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. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]> Cc: Andrey Ryabinin <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: "Steven Rostedt (VMware)" <[email protected]> Cc: Dmitry Vyukov <[email protected]> Cc: Anders Roxell <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]> (cherry picked from commit ec9672d) Orabug: 29558684 Signed-off-by: George Kennedy <[email protected]> Reviewed-by: John Donnelly <[email protected]>
1 parent 3b0c42e commit a4abeb0

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

kernel/kcov.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -446,10 +446,8 @@ static int __init kcov_init(void)
446446
* there is no need to protect it against removal races. The
447447
* use of debugfs_create_file_unsafe() is actually safe here.
448448
*/
449-
if (!debugfs_create_file_unsafe("kcov", 0600, NULL, NULL, &kcov_fops)) {
450-
pr_err("failed to create kcov in debugfs\n");
451-
return -ENOMEM;
452-
}
449+
debugfs_create_file_unsafe("kcov", 0600, NULL, NULL, &kcov_fops);
450+
453451
return 0;
454452
}
455453

0 commit comments

Comments
 (0)