diff options
author | Andi Kleen <andi@firstfloor.org> | 2009-12-16 06:20:01 -0500 |
---|---|---|
committer | Andi Kleen <ak@linux.intel.com> | 2009-12-16 06:20:01 -0500 |
commit | 0d57eb8dfcb92e3dd928d792f4ed2b2fec680bb7 (patch) | |
tree | 2aaf6d64134d380b3f17efd3aebb09d453f09e1d /mm/hwpoison-inject.c | |
parent | afcf938ee0aac4ef95b1a23bac704c6fbeb26de6 (diff) |
HWPOISON: Don't do early filtering if filter is disabled
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Diffstat (limited to 'mm/hwpoison-inject.c')
-rw-r--r-- | mm/hwpoison-inject.c | 3 |
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 | ||
53 | inject: | ||
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 | } |