Browse Source

monitor: Call mon_get_cpu() only once at hmp_gva2gpa()

hmp_gva2gpa() calls mon_get_cpu() twice, which is unnecessary.
Not an actual bug, but this is reported as a defect by Coverity
Scan (CID 1401346).

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Message-Id: <2019051018.15757-1-ehabkost@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
master
Eduardo Habkost 1 month ago
parent
commit
9d3250d5ba
1 changed files with 1 additions and 2 deletions
  1. 1
    2
      monitor.c

+ 1
- 2
monitor.c View File

@@ -1685,8 +1685,7 @@ static void hmp_gva2gpa(Monitor *mon, const QDict *qdict)
1685 1685
         return;
1686 1686
     }
1687 1687
 
1688
-    gpa  = cpu_get_phys_page_attrs_debug(mon_get_cpu(),
1689
-                                         addr & TARGET_PAGE_MASK, &attrs);
1688
+    gpa  = cpu_get_phys_page_attrs_debug(cs, addr & TARGET_PAGE_MASK, &attrs);
1690 1689
     if (gpa == -1) {
1691 1690
         monitor_printf(mon, "Unmapped\n");
1692 1691
     } else {

Loading…
Cancel
Save