OSDN Git Service

ui/console: new_console() cannot fail
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Wed, 30 Aug 2023 09:37:44 +0000 (13:37 +0400)
committerMarc-André Lureau <marcandre.lureau@redhat.com>
Mon, 4 Sep 2023 08:37:54 +0000 (12:37 +0400)
There is no code path that could allow a NULL return there.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20230830093843.3531473-11-marcandre.lureau@redhat.com>

ui/console.c

index 24cfd31..ddec68f 100644 (file)
@@ -2480,11 +2480,6 @@ static void vc_chr_open(Chardev *chr,
         s->surface = qemu_create_displaysurface(width, height);
     }
 
-    if (!s) {
-        error_setg(errp, "cannot create text console");
-        return;
-    }
-
     s->chr = chr;
     drv->console = s;