x86/insn-eval: Handle insn_get_opcode() failure
authorKirill A. Shutemov <kirill@shutemov.name>
Tue, 30 Nov 2021 18:49:30 +0000 (21:49 +0300)
committerDave Hansen <dave.hansen@linux.intel.com>
Tue, 30 Nov 2021 22:52:26 +0000 (14:52 -0800)
commit23ef731e4365196bfc186358eb4f6265d60ab352
tree90afa7b97341ebf4fd380d876022d3cc9328acdb
parentd58071a8a76d779eedab38033ae4c821c30295a5
x86/insn-eval: Handle insn_get_opcode() failure

is_string_insn() calls insn_get_opcode() that can fail, but does not
handle the failure.

is_string_insn() interface does not allow to communicate an error to the
caller.

Push insn_get_opcode() to the only non-static user of is_string_insn()
and fail it early if insn_get_opcode() fails.

[ dhansen: fix tabs-versus-spaces breakage ]

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Tested-by: Joerg Roedel <jroedel@suse.de>
Acked-by: Tom Lendacky <thomas.lendacky@amd.com>
Link: https://lkml.kernel.org/r/20211130184933.31005-2-kirill.shutemov@linux.intel.com
arch/x86/lib/insn-eval.c