]> git.proxmox.com Git - mirror_qemu.git/commit
hw/char/sh_serial: Do not abort on invalid access
authorBALATON Zoltan <balaton@eik.bme.hu>
Fri, 29 Oct 2021 21:02:09 +0000 (23:02 +0200)
committerPhilippe Mathieu-Daudé <f4bug@amsat.org>
Sat, 30 Oct 2021 16:39:37 +0000 (18:39 +0200)
commit3cf7ce4337aebf8f9148ee53033710b4c4b00f01
tree1e2c40944a19bc96f5b44c3fd8b6ff7ce11f0ed0
parent6e5dd76f213afc3fdf07ddebe3fed3980228f71b
hw/char/sh_serial: Do not abort on invalid access

Replace fprintf with qemu_log_mask LOG_GUEST_ERROR as the intention is
to handle valid accesses in these functions so if we get to these
errors then it's an invalid access. Do not abort as that would allow
the guest to crash QEMU and the practice in other devices is to not do
that just log and ignore the invalid access. While at it also simplify
the complex bit ops to check if a return value was set which can be
done much simpler and clearer.

Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <6b46045141d6d9cc32e17c223896fa1116384796.1635541329.git.balaton@eik.bme.hu>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
hw/char/sh_serial.c