virtio-gpu: remove needless condition
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Mon, 15 Jan 2024 15:10:56 +0000 (19:10 +0400)
committerMarc-André Lureau <marcandre.lureau@redhat.com>
Tue, 12 Mar 2024 13:57:58 +0000 (17:57 +0400)
qemu_create_displaysurface_pixman() never returns NULL.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
hw/display/virtio-gpu.c

index 1c1ee230b3e428547ad2786a3758e54f8a65478b..ccbe31d759b9f24b384416af6dd3e3cc7fe2be64 100644 (file)
@@ -684,10 +684,6 @@ static void virtio_gpu_do_set_scanout(VirtIOGPU *g,
 
         /* realloc the surface ptr */
         scanout->ds = qemu_create_displaysurface_pixman(rect);
-        if (!scanout->ds) {
-            *error = VIRTIO_GPU_RESP_ERR_UNSPEC;
-            return;
-        }
 #ifdef WIN32
         qemu_displaysurface_win32_set_handle(scanout->ds, res->handle, fb->offset);
 #endif
@@ -1423,9 +1419,6 @@ static int virtio_gpu_post_load(void *opaque, int version_id)
             return -EINVAL;
         }
         scanout->ds = qemu_create_displaysurface_pixman(res->image);
-        if (!scanout->ds) {
-            return -EINVAL;
-        }
 #ifdef WIN32
         qemu_displaysurface_win32_set_handle(scanout->ds, res->handle, 0);
 #endif