hc
2023-12-06 08f87f769b595151be1afeff53e144f543faa614
kernel/lib/notifier-error-inject.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 #include <linux/module.h>
23
34 #include "notifier-error-inject.h"
....@@ -58,33 +59,22 @@
5859 err_inject->nb.priority = priority;
5960
6061 dir = debugfs_create_dir(name, parent);
61
- if (!dir)
62
- return ERR_PTR(-ENOMEM);
6362
6463 actions_dir = debugfs_create_dir("actions", dir);
65
- if (!actions_dir)
66
- goto fail;
6764
6865 for (action = err_inject->actions; action->name; action++) {
6966 struct dentry *action_dir;
7067
7168 action_dir = debugfs_create_dir(action->name, actions_dir);
72
- if (!action_dir)
73
- goto fail;
7469
7570 /*
7671 * Create debugfs r/w file containing action->error. If
7772 * notifier call chain is called with action->val, it will
7873 * fail with the error code
7974 */
80
- if (!debugfs_create_errno("error", mode, action_dir,
81
- &action->error))
82
- goto fail;
75
+ debugfs_create_errno("error", mode, action_dir, &action->error);
8376 }
8477 return dir;
85
-fail:
86
- debugfs_remove_recursive(dir);
87
- return ERR_PTR(-ENOMEM);
8878 }
8979 EXPORT_SYMBOL_GPL(notifier_err_inject_init);
9080