ramfb: don't update RAMFBState on errors
commit19aaee2a65a26693fe0a30b5a0746f967774e278
authorGerd Hoffmann <kraxel@redhat.com>
Wed, 29 Apr 2020 11:52:34 +0000 (29 13:52 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Mon, 18 May 2020 13:43:35 +0000 (18 15:43 +0200)
tree81ac04311310b6792cbbfa1f0b22d538bd4b6cd3
parent46a298d60271f03d4f85031827426fca67af2a20
ramfb: don't update RAMFBState on errors

Store width & height & surface in local variables.  Update RAMFBState
with the new values only in case the ramfb_create_display_surface() call
succeeds.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Message-id: 20200429115236.28709-5-kraxel@redhat.com
hw/display/ramfb.c