diff options
| author | Masami Hiramatsu (Google) <[email protected]> | 2022-12-12 02:46:44 +0000 |
|---|---|---|
| committer | Andrew Morton <[email protected]> | 2023-02-03 06:50:00 +0000 |
| commit | 6338bb05c15f88e2f4beae296ef389224837758c (patch) | |
| tree | 1273c186ee0c370df1aecbff68c98738f69e2824 /lib/error-inject.c | |
| parent | arch/alpha/kernel/process.c: remove unnecessary (void*) conversions (diff) | |
| download | kernel-6338bb05c15f88e2f4beae296ef389224837758c.tar.gz kernel-6338bb05c15f88e2f4beae296ef389224837758c.zip | |
error-injection: remove EI_ETYPE_NONE
Patch series "error-injection: Clarify the requirements of error
injectable functions".
Patches for clarifying the requirement of error injectable functions and
to remove the confusing EI_ETYPE_NONE.
This patch (of 2):
Since the EI_ETYPE_NONE is confusing type, replace it with appropriate
errno. The EI_ETYPE_NONE has been introduced for a dummy (error) value,
but it can mislead people that they can use ALLOW_ERROR_INJECTION(func,
NONE). So remove it from the EI_ETYPE and use appropriate errno instead.
[[email protected]: include/linux/error-injection.h needs errno.h]
Link: https://lkml.kernel.org/r/167081319306.387937.10079195394503045678.stgit@devnote3
Link: https://lkml.kernel.org/r/167081320421.387937.4259807348852421112.stgit@devnote3
Fixes: 663faf9f7bee ("error-injection: Add injectable error types")
Signed-off-by: Masami Hiramatsu (Google) <[email protected]>
Cc: Alexei Starovoitov <[email protected]>
Cc: Borislav Petkov (AMD) <[email protected]>
Cc: Chris Mason <[email protected]>
Cc: Christoph Hellwig <[email protected]>
Cc: Florent Revest <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Jonathan Corbet <[email protected]>
Cc: Josh Poimboeuf <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: KP Singh <[email protected]>
Cc: Mark Rutland <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Steven Rostedt (Google) <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'lib/error-inject.c')
| -rw-r--r-- | lib/error-inject.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/error-inject.c b/lib/error-inject.c index 1afca1b1cdea..32c14770508e 100644 --- a/lib/error-inject.c +++ b/lib/error-inject.c @@ -40,7 +40,7 @@ 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; + int ei_type = -EINVAL; mutex_lock(&ei_mutex); list_for_each_entry(ent, &error_injection_list, list) { |
