Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fdb871aa authored by Will Deacon's avatar Will Deacon Committed by David Brown
Browse files

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: default avatarGene Hackmann <ghackmann@google.com>
Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
Signed-off-by: default avatarDavid Brown <david.brown@linaro.org>
parent fbfbacfb
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);