diff options
author | Will Deacon <will.deacon@arm.com> | 2014-11-25 10:05:35 +0000 |
---|---|---|
committer | Daniel Rosenberg <drosen@google.com> | 2015-02-05 15:36:26 -0800 |
commit | 36a7a4fcd9555013c7e79d96c60c40f09688b051 (patch) | |
tree | a8d64f1c3910554379ddd5f3465dbbcd08bb131a | |
parent | 554e28be8b846cf5c240774de9337afbb37c0744 (diff) |
arm64: fix return code check when changing emulation handler
update_insn_emulation_mode() returns 0 on success, so we should be
treating any non-zero values as failure, rather than the other way
around. Otherwise, writes to the sysctl file controlling the emulation
are ignored and immediately rolled back.
Reported-by: Gene Hackmann <ghackmann@google.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
-rw-r--r-- | arch/arm64/kernel/armv8_deprecated.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm64/kernel/armv8_deprecated.c b/arch/arm64/kernel/armv8_deprecated.c index 529aad93336f..c363671d7509 100644 --- a/arch/arm64/kernel/armv8_deprecated.c +++ b/arch/arm64/kernel/armv8_deprecated.c @@ -165,7 +165,7 @@ static int emulation_proc_handler(struct ctl_table *table, int write, goto ret; ret = update_insn_emulation_mode(insn, prev_mode); - if (!ret) { + if (ret) { /* Mode change failed, revert to previous mode. */ insn->current_mode = prev_mode; update_insn_emulation_mode(insn, INSN_UNDEF); |