diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2022-06-28 16:54:05 +1000 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2022-06-28 16:54:05 +1000 |
commit | 5f9df76887bf8170e8844f1907c13fbbb30e9c36 (patch) | |
tree | 3b940f7e1c36605af69ffe3a3e9bc8fa53bd12a1 /lib/error-inject.c | |
parent | 8f850ad6cf932b8b5125f9585cb397e08403cccd (diff) | |
parent | 84b494dcbcc015419e629ced664d3b737e83336e (diff) | |
download | linux-next-5f9df76887bf8170e8844f1907c13fbbb30e9c36.tar.gz |
# Conflicts:
# include/linux/pagevec.h
Diffstat (limited to 'lib/error-inject.c')
-rw-r--r-- | lib/error-inject.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/error-inject.c b/lib/error-inject.c index 4a4f1278c419..1afca1b1cdea 100644 --- a/lib/error-inject.c +++ b/lib/error-inject.c @@ -40,12 +40,18 @@ bool within_error_injection_list(unsigned long addr) int get_injectable_error_type(unsigned long addr) { struct ei_entry *ent; + int ei_type = EI_ETYPE_NONE; + mutex_lock(&ei_mutex); list_for_each_entry(ent, &error_injection_list, list) { - if (addr >= ent->start_addr && addr < ent->end_addr) - return ent->etype; + if (addr >= ent->start_addr && addr < ent->end_addr) { + ei_type = ent->etype; + break; + } } - return EI_ETYPE_NONE; + mutex_unlock(&ei_mutex); + + return ei_type; } /* |