]> www.infradead.org Git - users/dwmw2/linux.git/commit
x86/insn-eval: Handle return values from the decoder
authorBorislav Petkov <bp@suse.de>
Thu, 19 Nov 2020 18:20:18 +0000 (19:20 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 25 Jul 2022 09:26:11 +0000 (11:26 +0200)
commite6f8dc86a1c15b862486a61abcb54b88e8c177e3
tree903ea7f71414c6b7f0a8a09e9854b6c9178569d5
parent6bc6875b82a0cb99212c4b78fe7606418888af30
x86/insn-eval: Handle return values from the decoder

commit 6e8c83d2a3afbfd5ee019ec720b75a42df515caa upstream.

Now that the different instruction-inspecting functions return a value,
test that and return early from callers if error has been encountered.

While at it, do not call insn_get_modrm() when calling
insn_get_displacement() because latter will make sure to call
insn_get_modrm() if ModRM hasn't been parsed yet.

Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20210304174237.31945-6-bp@alien8.de
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/lib/insn-eval.c