aboutsummaryrefslogtreecommitdiffstats
path: root/mm/hwpoison-inject.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/hwpoison-inject.c')
-rw-r--r--mm/hwpoison-inject.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/mm/hwpoison-inject.c b/mm/hwpoison-inject.c
index a77fe3f9e211..10ea71905c1f 100644
--- a/mm/hwpoison-inject.c
+++ b/mm/hwpoison-inject.c
@@ -18,6 +18,8 @@ static int hwpoison_inject(void *data, u64 val)
18 if (!capable(CAP_SYS_ADMIN)) 18 if (!capable(CAP_SYS_ADMIN))
19 return -EPERM; 19 return -EPERM;
20 20
21 if (!hwpoison_filter_enable)
22 goto inject;
21 if (!pfn_valid(pfn)) 23 if (!pfn_valid(pfn))
22 return -ENXIO; 24 return -ENXIO;
23 25
@@ -48,6 +50,7 @@ static int hwpoison_inject(void *data, u64 val)
48 if (err) 50 if (err)
49 return 0; 51 return 0;
50 52
53inject:
51 printk(KERN_INFO "Injecting memory failure at pfn %lx\n", pfn); 54 printk(KERN_INFO "Injecting memory failure at pfn %lx\n", pfn);
52 return __memory_failure(pfn, 18, MF_COUNT_INCREASED); 55 return __memory_failure(pfn, 18, MF_COUNT_INCREASED);
53} 56}