summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mm/hwpoison-inject.c67
1 files changed, 22 insertions, 45 deletions
diff --git a/mm/hwpoison-inject.c b/mm/hwpoison-inject.c
index 1a7497d015b2..5b7430bd83a6 100644
--- a/mm/hwpoison-inject.c
+++ b/mm/hwpoison-inject.c
@@ -77,63 +77,40 @@ static void pfn_inject_exit(void)
static int pfn_inject_init(void)
{
- struct dentry *dentry;
-
hwpoison_dir = debugfs_create_dir("hwpoison", NULL);
- if (hwpoison_dir == NULL)
- return -ENOMEM;
/*
* Note that the below poison/unpoison interfaces do not involve
* hardware status change, hence do not require hardware support.
* They are mainly for testing hwpoison in software level.
*/
- dentry = debugfs_create_file("corrupt-pfn", 0200, hwpoison_dir,
- NULL, &hwpoison_fops);
- if (!dentry)
- goto fail;
-
- dentry = debugfs_create_file("unpoison-pfn", 0200, hwpoison_dir,
- NULL, &unpoison_fops);
- if (!dentry)
- goto fail;
-
- dentry = debugfs_create_u32("corrupt-filter-enable", 0600,
- hwpoison_dir, &hwpoison_filter_enable);
- if (!dentry)
- goto fail;
-
- dentry = debugfs_create_u32("corrupt-filter-dev-major", 0600,
- hwpoison_dir, &hwpoison_filter_dev_major);
- if (!dentry)
- goto fail;
-
- dentry = debugfs_create_u32("corrupt-filter-dev-minor", 0600,
- hwpoison_dir, &hwpoison_filter_dev_minor);
- if (!dentry)
- goto fail;
-
- dentry = debugfs_create_u64("corrupt-filter-flags-mask", 0600,
- hwpoison_dir, &hwpoison_filter_flags_mask);
- if (!dentry)
- goto fail;
-
- dentry = debugfs_create_u64("corrupt-filter-flags-value", 0600,
- hwpoison_dir, &hwpoison_filter_flags_value);
- if (!dentry)
- goto fail;
+ debugfs_create_file("corrupt-pfn", 0200, hwpoison_dir, NULL,
+ &hwpoison_fops);
+
+ debugfs_create_file("unpoison-pfn", 0200, hwpoison_dir, NULL,
+ &unpoison_fops);
+
+ debugfs_create_u32("corrupt-filter-enable", 0600, hwpoison_dir,
+ &hwpoison_filter_enable);
+
+ debugfs_create_u32("corrupt-filter-dev-major", 0600, hwpoison_dir,
+ &hwpoison_filter_dev_major);
+
+ debugfs_create_u32("corrupt-filter-dev-minor", 0600, hwpoison_dir,
+ &hwpoison_filter_dev_minor);
+
+ debugfs_create_u64("corrupt-filter-flags-mask", 0600, hwpoison_dir,
+ &hwpoison_filter_flags_mask);
+
+ debugfs_create_u64("corrupt-filter-flags-value", 0600, hwpoison_dir,
+ &hwpoison_filter_flags_value);
#ifdef CONFIG_MEMCG
- dentry = debugfs_create_u64("corrupt-filter-memcg", 0600,
- hwpoison_dir, &hwpoison_filter_memcg);
- if (!dentry)
- goto fail;
+ debugfs_create_u64("corrupt-filter-memcg", 0600, hwpoison_dir,
+ &hwpoison_filter_memcg);
#endif
return 0;
-fail:
- pfn_inject_exit();
- return -ENOMEM;
}
module_init(pfn_inject_init);