[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PULL 09/21] i386/xen: Don't inject event on invalid port in qmp_xen_event_inject()



From: David Woodhouse <dwmw@xxxxxxxxxxxx>

qmp_xen_event_inject() reported the invalid port with error_setg() but
then carried on regardless, passing it to set_port_pending(). Return
after setting the error.

Fixes: 507cb64d6e66 ("i386/xen: add monitor commands to test event injection")
Reported-by: Hui Peng <benquike@xxxxxxxxx>
Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/4525
Reviewed-by: Paul Durrant <paul@xxxxxxx>
Reviewed-by: Philippe Mathieu-Daudé <philmd@xxxxxxxxxxxxxxxx>
Signed-off-by: David Woodhouse <dwmw@xxxxxxxxxxxx>
---
 hw/i386/kvm/xen_evtchn.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/i386/kvm/xen_evtchn.c b/hw/i386/kvm/xen_evtchn.c
index d0807f5fec..7fd8c3f318 100644
--- a/hw/i386/kvm/xen_evtchn.c
+++ b/hw/i386/kvm/xen_evtchn.c
@@ -2342,6 +2342,7 @@ void qmp_xen_event_inject(uint32_t port, Error **errp)
 
     if (!valid_port(port)) {
         error_setg(errp, "Invalid port %u", port);
+        return;
     }
 
     QEMU_LOCK_GUARD(&s->port_lock);
-- 
2.55.0




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.