qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] multi-process: Avoid logical AND of mutually exclusive tests
@ 2021-05-07 15:53 Jagannathan Raman
  2021-05-08  4:34 ` Thomas Huth
  2021-05-13 16:02 ` Stefan Hajnoczi
  0 siblings, 2 replies; 4+ messages in thread
From: Jagannathan Raman @ 2021-05-07 15:53 UTC (permalink / raw)
  To: qemu-devel
  Cc: elena.ufimtseva, john.g.johnson, thuth, jag.raman, stefanha, berrange

Fixes an if statement that performs a logical AND of mutually exclusive
tests

Reported-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Jagannathan Raman <jag.raman@oracle.com>
---
 hw/remote/mpqemu-link.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/remote/mpqemu-link.c b/hw/remote/mpqemu-link.c
index 9ce3152..e67a5de 100644
--- a/hw/remote/mpqemu-link.c
+++ b/hw/remote/mpqemu-link.c
@@ -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;
     }
 
-- 
1.8.3.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-05-13 16:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-07 15:53 [PATCH] multi-process: Avoid logical AND of mutually exclusive tests Jagannathan Raman
2021-05-08  4:34 ` Thomas Huth
2021-05-13 16:16   ` Laurent Vivier
2021-05-13 16:02 ` Stefan Hajnoczi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).