• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Révision617dff091f3478db9a44320df03f74b9df0617fb (tree)
l'heure2022-01-28 23:29:46
AuteurPeter Maydell <peter.maydell@lina...>
CommiterPeter Maydell

Message de Log

hw/char/exynos4210_uart: Fix crash on trying to load VM state

The exynos4210_uart_post_load() function assumes that it is passed
the Exynos4210UartState, but it has been attached to the
VMStateDescription for the Exynos4210UartFIFO type. The result is a
SIGSEGV when attempting to load VM state for any machine type
including this device.

Fix the bug by attaching the post-load function to the VMSD for the
Exynos4210UartState. This is the logical place for it, because the
actions it does relate to the entire UART state, not just the FIFO.

Thanks to the bug reporter @TrungNguyen1909 for the clear bug
description and the suggested fix.

Fixes: c9d3396d80fe7ece9b

("hw/char/exynos4210_uart: Implement post_load function")

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/638
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 20220120151648.433736-1-peter.maydell@linaro.org

Change Summary

Modification

--- a/hw/char/exynos4210_uart.c
+++ b/hw/char/exynos4210_uart.c
@@ -628,7 +628,6 @@ static const VMStateDescription vmstate_exynos4210_uart_fifo = {
628628 .name = "exynos4210.uart.fifo",
629629 .version_id = 1,
630630 .minimum_version_id = 1,
631- .post_load = exynos4210_uart_post_load,
632631 .fields = (VMStateField[]) {
633632 VMSTATE_UINT32(sp, Exynos4210UartFIFO),
634633 VMSTATE_UINT32(rp, Exynos4210UartFIFO),
@@ -641,6 +640,7 @@ static const VMStateDescription vmstate_exynos4210_uart = {
641640 .name = "exynos4210.uart",
642641 .version_id = 1,
643642 .minimum_version_id = 1,
643+ .post_load = exynos4210_uart_post_load,
644644 .fields = (VMStateField[]) {
645645 VMSTATE_STRUCT(rx, Exynos4210UartState, 1,
646646 vmstate_exynos4210_uart_fifo, Exynos4210UartFIFO),