multi-process: Avoid logical AND of mutually exclusive tests
authorJagannathan Raman <jag.raman@oracle.com>
Fri, 7 May 2021 15:53:23 +0000 (11:53 -0400)
committerLaurent Vivier <laurent@vivier.eu>
Thu, 13 May 2021 16:15:32 +0000 (18:15 +0200)
Fixes an if statement that performs a logical AND of mutually exclusive
tests

Buglink: https://bugs.launchpad.net/qemu/+bug/1926995
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Jagannathan Raman <jag.raman@oracle.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <1620402803-9237-1-git-send-email-jag.raman@oracle.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
hw/remote/mpqemu-link.c

index 9ce31526e8f24919b1d86240e476f968e9131c58..e67a5de72ca79c0935dc82ef88d4e32933cfe3de 100644 (file)
@@ -218,7 +218,7 @@ uint64_t mpqemu_msg_send_and_await_reply(MPQemuMsg *msg, PCIProxyDev *pdev,
 
 bool mpqemu_msg_valid(MPQemuMsg *msg)
 {
-    if (msg->cmd >= MPQEMU_CMD_MAX && msg->cmd < 0) {
+    if (msg->cmd >= MPQEMU_CMD_MAX || msg->cmd < 0) {
         return false;
     }