History

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.

Greg Kroah-Hartman committed 7 years ago

Commit fecb0d91 parent d1fdb6d1 file · +2 −12Browse files

Unified · Split

lib/debugobjects.c+2−12
@@ -850,26 +850,16 @@ static const struct file_operations debug_stats_fops = { · 849 unmodified lines
850850
851851 static int __init debug_objects_init_debugfs(void)
852852 {
853− struct dentry *dbgdir, *dbgstats;
853+ struct dentry *dbgdir;
854854
855855 if (!debug_objects_enabled)
856856 return 0;
857857
858858 dbgdir = debugfs_create_dir("debug_objects", NULL);
859− if (!dbgdir)
860− return -ENOMEM;
861859
862− dbgstats = debugfs_create_file("stats", 0444, dbgdir, NULL,
863− &debug_stats_fops);
864− if (!dbgstats)
865− goto err;
860+ debugfs_create_file("stats", 0444, dbgdir, NULL, &debug_stats_fops);
866861
867862 return 0;
868−
869−err:
870− debugfs_remove(dbgdir);
871−
872− return -ENOMEM;
873863 }
874864 __initcall(debug_objects_init_debugfs);
875865