]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
hw/xen: Fix broken check for invalid state in xs_be_open()
authorDavid Woodhouse <dwmw@amazon.co.uk>
Wed, 12 Apr 2023 18:51:02 +0000 (19:51 +0100)
committerMichael Tokarev <mjt@tls.msk.ru>
Wed, 7 Jun 2023 19:47:56 +0000 (22:47 +0300)
Coverity points out that if (!s && !s->impl) isn't really what we intended
to do here. CID 1508131.

Fixes: 032475127225 ("hw/xen: Add emulated implementation of XenStore operations")
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <20230412185102.441523-6-dwmw2@infradead.org>
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
(cherry picked from commit c9bdfe8d587c1a6a8fc2e0ff97343745a9f5f247)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
hw/i386/kvm/xen_xenstore.c

index 900679af8a158ce8298299a33dd605735a4c8079..65f91e87d730964201717d9008c968a93146318e 100644 (file)
@@ -1688,7 +1688,7 @@ static struct qemu_xs_handle *xs_be_open(void)
     XenXenstoreState *s = xen_xenstore_singleton;
     struct qemu_xs_handle *h;
 
-    if (!s && !s->impl) {
+    if (!s || !s->impl) {
         errno = -ENOSYS;
         return NULL;
     }