aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill Deacon <will.deacon@arm.com>2014-11-25 10:05:35 +0000
committerDavid Brown <david.brown@linaro.org>2015-12-03 16:53:46 -0800
commitfdb871aacca844cc6458cfa684be890f0f532d88 (patch)
treee00c65c0d6737bc3ee5f7a187e566bc2596a4f9d
parentfbfbacfbaa12f3c3c1f983a28980688b2f83e8a8 (diff)
downloadlinux-linaro-stable-fdb871aacca844cc6458cfa684be890f0f532d88.tar.gz
arm64: fix return code check when changing emulation handler
commit 909633957d85561dab7655d69a9d17dd16231d92 upstream. 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> Signed-off-by: David Brown <david.brown@linaro.org>
-rw-r--r--arch/arm64/kernel/armv8_deprecated.c2
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);