multi-process: Avoid logical AND of mutually exclusive tests
PATCH 1/1 multi-process: Avoid logical AND of mutually exclusive tests
Fixes an if statement that performs a logical AND of mutually exclusive tests
Reported-by Thomas Huth <[email protected]>
Signed-off-by Jagannathan Raman <[email protected]>
--- hw/remote/mpqemu-link.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/remote/mpqemu-link.c +1 -1
@@ -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; }
Signature · 1 line
1.8.3.1
Quoted 4 lines · Jagannathan Raman
Fixes an if statement that performs a logical AND of mutually exclusive tests
Reported-by Thomas Huth <[email protected]>
I just spotted the bug ticket on Launchpad :-) So whoever picks this patch up, please add this instead:
Reviewed-by Thomas Huth <[email protected]>
Quoted 17 lines
Signed-off-by Jagannathan Raman <[email protected]>--- hw/remote/mpqemu-link.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)hw/remote/mpqemu-link.c +1
-1@@ -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; }
Laurent Vivier
AppliedLe 08/05/2021 à 06:34, Thomas Huth a écrit :
Quoted 10 lines · Jagannathan Raman
Quoted 4 lines
Fixes an if statement that performs a logical AND of mutually exclusive tests
Reported-by Thomas Huth <[email protected]>I just spotted the bug ticket on Launchpad :-) So whoever picks this patch up, please add this instead:
Reviewed-by Thomas Huth <[email protected]>
Applied to my trivial-patches branch.
Thanks,
Laurent
Quoted 18 lines
Quoted 16 lines
Signed-off-by Jagannathan Raman <[email protected]>---
hw/remote/mpqemu-link.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)hw/remote/mpqemu-link.c +1
-1@@ -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; }
Quoted 8 lines · Jagannathan Raman
Fixes an if statement that performs a logical AND of mutually exclusive tests
Reported-by Thomas Huth <[email protected]>Signed-off-by Jagannathan Raman <[email protected]>--- hw/remote/mpqemu-link.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by Stefan Hajnoczi <[email protected]>