[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 04/12] hw/xen: Fix broken check for invalid state in xs_be_open()
From: |
Anthony PERARD |
Subject: |
[PULL 04/12] hw/xen: Fix broken check for invalid state in xs_be_open() |
Date: |
Wed, 7 Jun 2023 15:18:31 +0100 |
From: David Woodhouse <dwmw@amazon.co.uk>
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>
---
hw/i386/kvm/xen_xenstore.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/i386/kvm/xen_xenstore.c b/hw/i386/kvm/xen_xenstore.c
index 0b189c6ab8..133d89e953 100644
--- a/hw/i386/kvm/xen_xenstore.c
+++ b/hw/i386/kvm/xen_xenstore.c
@@ -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;
}
--
Anthony PERARD
- [PULL 00/12] xen queue, Anthony PERARD, 2023/06/07
- [PULL 02/12] hw/xen: Fix memory leak in libxenstore_open() for Xen, Anthony PERARD, 2023/06/07
- [PULL 03/12] xen: Drop support for Xen versions below 4.7.1, Anthony PERARD, 2023/06/07
- [PULL 06/12] hw/pci/pci.c: Don't leak PCIBus::irq_count[] in pci_bus_irqs(), Anthony PERARD, 2023/06/07
- [PULL 04/12] hw/xen: Fix broken check for invalid state in xs_be_open(),
Anthony PERARD <=
- [PULL 01/12] hw/xen: Simplify emulated Xen platform init, Anthony PERARD, 2023/06/07
- [PULL 07/12] hw/isa/piix3: Reuse piix3_realize() in piix3_xen_realize(), Anthony PERARD, 2023/06/07
- [PULL 09/12] hw/isa/piix3: Avoid Xen-specific variant of piix3_write_config(), Anthony PERARD, 2023/06/07
- [PULL 05/12] include/hw/xen/xen: Rename xen_piix3_set_irq() to xen_intx_set_irq(), Anthony PERARD, 2023/06/07
- [PULL 11/12] hw/isa/piix3: Resolve redundant TYPE_PIIX3_XEN_DEVICE, Anthony PERARD, 2023/06/07
- [PULL 12/12] xen-block: fix segv on unrealize, Anthony PERARD, 2023/06/07
- [PULL 08/12] hw/isa/piix3: Wire up Xen PCI IRQ handling outside of PIIX3, Anthony PERARD, 2023/06/07
- [PULL 10/12] hw/isa/piix3: Resolve redundant k->config_write assignments, Anthony PERARD, 2023/06/07
- Re: [PULL 00/12] xen queue, Michael Tokarev, 2023/06/07
- Re: [PULL 00/12] xen queue, Richard Henderson, 2023/06/07