Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
hw/xen: Fix broken check for invalid state in xs_be_open()
Coverity points out that if (!s && !s->impl) isn't really what we intended
to do here. CID 1508131.

Fixes: 0324751 ("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>
  • Loading branch information
dwmw2 authored and anthonyper-ctx committed Jun 7, 2023
1 parent 2f20b17 commit c9bdfe8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hw/i386/kvm/xen_xenstore.c
Expand Up @@ -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;
}
Expand Down

0 comments on commit c9bdfe8

Please sign in to comment.