qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] monitor: Fix gva2gpa coverityism
@ 2019-05-10 19:01 Dr. David Alan Gilbert (git)
  2019-05-15 10:38 ` Stefan Hajnoczi
  0 siblings, 1 reply; 2+ messages in thread
From: Dr. David Alan Gilbert (git) @ 2019-05-10 19:01 UTC (permalink / raw)
  To: qemu-devel

From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>

Coverity is complaining that while I'm checking the return
value of mon_get_cpu(), I'm not actually using the checked value,
I'm calling it again and thus it's worried I might get null;
I don't think that's actually possible since i'm under
lock anyway.
However, it's a sensible cleanup.

CID: 1401346

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
 monitor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/monitor.c b/monitor.c
index bb48997913..f93c4b5c76 100644
--- a/monitor.c
+++ b/monitor.c
@@ -1685,7 +1685,7 @@ static void hmp_gva2gpa(Monitor *mon, const QDict *qdict)
         return;
     }
 
-    gpa  = cpu_get_phys_page_attrs_debug(mon_get_cpu(),
+    gpa  = cpu_get_phys_page_attrs_debug(cs,
                                          addr & TARGET_PAGE_MASK, &attrs);
     if (gpa == -1) {
         monitor_printf(mon, "Unmapped\n");
-- 
2.21.0



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

* Re: [Qemu-devel] [PATCH] monitor: Fix gva2gpa coverityism
  2019-05-10 19:01 [Qemu-devel] [PATCH] monitor: Fix gva2gpa coverityism Dr. David Alan Gilbert (git)
@ 2019-05-15 10:38 ` Stefan Hajnoczi
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Hajnoczi @ 2019-05-15 10:38 UTC (permalink / raw)
  To: Dr. David Alan Gilbert (git); +Cc: qemu-devel

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

On Fri, May 10, 2019 at 08:01:40PM +0100, Dr. David Alan Gilbert (git) wrote:
> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
> 
> Coverity is complaining that while I'm checking the return
> value of mon_get_cpu(), I'm not actually using the checked value,
> I'm calling it again and thus it's worried I might get null;
> I don't think that's actually possible since i'm under
> lock anyway.
> However, it's a sensible cleanup.
> 
> CID: 1401346
> 
> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> ---
>  monitor.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] 2+ messages in thread

end of thread, other threads:[~2019-05-15 10:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-10 19:01 [Qemu-devel] [PATCH] monitor: Fix gva2gpa coverityism Dr. David Alan Gilbert (git)
2019-05-15 10:38 ` 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).