Commit ff82fab7 authored by Paolo Bonzini's avatar Paolo Bonzini
Browse files

chardev-socket: remove useless if



This trips Coverity, which believes the subsequent qio_channel_create_watch
can dereference a NULL pointer.  In reality, tcp_chr_connect's callers
all have s->ioc properly initialized, since they are all rooted at
tcp_chr_new_client.

Reviewed-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 87f963be
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -550,12 +550,10 @@ static void tcp_chr_connect(void *opaque)
        s->is_listen, s->is_telnet);

    s->connected = 1;
    if (s->ioc) {
    chr->gsource = io_add_watch_poll(chr, s->ioc,
                                       tcp_chr_read_poll,
                                       tcp_chr_read,
                                       chr, chr->gcontext);
    }

    s->hup_source = qio_channel_create_watch(s->ioc, G_IO_HUP);
    g_source_set_callback(s->hup_source, (GSourceFunc)tcp_chr_hup,