From ec14a3de622ae30a8afa78b6f564bc743b753ee1 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Wed, 23 Jul 2025 15:32:57 +0200 Subject: vfio scsi ui: Error-check qio_channel_socket_connect_sync() the same way qio_channel_socket_connect_sync() returns 0 on success, and -1 on failure, with errp set. Some callers check the return value, and some check whether errp was set. For consistency, always check the return value, and always check it's negative. Signed-off-by: Markus Armbruster Message-ID: <20250723133257.1497640-3-armbru@redhat.com> Reviewed-by: Zhao Liu --- hw/vfio-user/proxy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hw') diff --git a/hw/vfio-user/proxy.c b/hw/vfio-user/proxy.c index 2275d3f..2c03d49 100644 --- a/hw/vfio-user/proxy.c +++ b/hw/vfio-user/proxy.c @@ -885,7 +885,7 @@ VFIOUserProxy *vfio_user_connect_dev(SocketAddress *addr, Error **errp) sioc = qio_channel_socket_new(); ioc = QIO_CHANNEL(sioc); - if (qio_channel_socket_connect_sync(sioc, addr, errp)) { + if (qio_channel_socket_connect_sync(sioc, addr, errp) < 0) { object_unref(OBJECT(ioc)); return NULL; } -- cgit v1.1