From: Andi Kleen Date: Wed, 16 Dec 2009 11:20:01 +0000 (+0100) Subject: HWPOISON: Don't do early filtering if filter is disabled X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0d57eb8dfcb92e3dd928d792f4ed2b2fec680bb7;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git HWPOISON: Don't do early filtering if filter is disabled Signed-off-by: Andi Kleen --- 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) if (!capable(CAP_SYS_ADMIN)) return -EPERM; + if (!hwpoison_filter_enable) + goto inject; if (!pfn_valid(pfn)) return -ENXIO; @@ -48,6 +50,7 @@ static int hwpoison_inject(void *data, u64 val) if (err) return 0; +inject: printk(KERN_INFO "Injecting memory failure at pfn %lx\n", pfn); return __memory_failure(pfn, 18, MF_COUNT_INCREASED); }