提交 90963395 编写于 作者: W Will Deacon

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: NGene Hackmann <ghackmann@google.com>
Signed-off-by: NWill Deacon <will.deacon@arm.com>
上级 7f73f7ae
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册