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

* Re: [PATCH] multi-process: Avoid logical AND of mutually exclusive tests
  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
  1 sibling, 1 reply; 4+ messages in thread
From: Thomas Huth @ 2021-05-08  4:34 UTC (permalink / raw)
  To: Jagannathan Raman, qemu-devel
  Cc: elena.ufimtseva, john.g.johnson, QEMU Trivial, berrange, stefanha

On 07/05/2021 17.53, Jagannathan Raman wrote:
> Fixes an if statement that performs a logical AND of mutually exclusive
> tests
> 
> Reported-by: Thomas Huth <thuth@redhat.com>

I just spotted the bug ticket on Launchpad :-) So whoever picks this patch 
up, please add this instead:

Buglink: https://bugs.launchpad.net/qemu/+bug/1926995
Reviewed-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;
>       }



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

* Re: [PATCH] multi-process: Avoid logical AND of mutually exclusive tests
  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:02 ` Stefan Hajnoczi
  1 sibling, 0 replies; 4+ messages in thread
From: Stefan Hajnoczi @ 2021-05-13 16:02 UTC (permalink / raw)
  To: Jagannathan Raman
  Cc: elena.ufimtseva, john.g.johnson, thuth, berrange, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 408 bytes --]

On Fri, May 07, 2021 at 11:53:23AM -0400, Jagannathan Raman wrote:
> 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(-)

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH] multi-process: Avoid logical AND of mutually exclusive tests
  2021-05-08  4:34 ` Thomas Huth
@ 2021-05-13 16:16   ` Laurent Vivier
  0 siblings, 0 replies; 4+ messages in thread
From: Laurent Vivier @ 2021-05-13 16:16 UTC (permalink / raw)
  To: Thomas Huth, Jagannathan Raman, qemu-devel
  Cc: elena.ufimtseva, john.g.johnson, QEMU Trivial, berrange, stefanha

Le 08/05/2021 à 06:34, Thomas Huth a écrit :
> On 07/05/2021 17.53, Jagannathan Raman wrote:
>> Fixes an if statement that performs a logical AND of mutually exclusive
>> tests
>>
>> Reported-by: Thomas Huth <thuth@redhat.com>
> 
> I just spotted the bug ticket on Launchpad :-) So whoever picks this patch up, please add this instead:
> 
> Buglink: https://bugs.launchpad.net/qemu/+bug/1926995
> Reviewed-by: Thomas Huth <thuth@redhat.com>

Applied to my trivial-patches branch.

Thanks,
Laurent

>> 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;
>>       }
> 
> 



^ permalink raw reply	[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).