Skip to contentSkip to conversation

qemu: avoid returning uninitialized value in apic_mem_readl

PATCH In review Carlo Marcelo Arenas Belon 2 participants 2 messages Apr 6, 2008 – Apr 7, 2008 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qemu: avoid returning uninitialized value in apic_mem_readl

complement 64173d009c1f4d163c425b14aa650df5b982428a to avoid :

kvm-65/qemu/hw/apic.c: In function `apic_mem_readl':
kvm-65/qemu/hw/apic.c:592: warning: 'val' might be used uninitialized in this function

---
 qemu/hw/apic.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
qemu/hw/apic.c +1 -0
index 4102493..b69ad75 100644
@@ -616,6 +616,7 @@ static uint32_t apic_mem_readl(void *opaque, target_phys_addr_t addr)
         val = apic_get_ppr(s);
         break;
     case 0x0b:
+        val = 0;
         break;
     case 0x0d:
         val = s->log_dest << 24;
Signature · 8 lines
1.5.3.7


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Register now and save $200. Hurry, offer ends at 11:59 p.m., 
Monday, April 7! Use priority code J8TLD2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
#1 lore raw
Quoted 15 lines · Carlo Marcelo Arenas Belon

complement 64173d009c1f4d163c425b14aa650df5b982428a to avoid :

kvm-65/qemu/hw/apic.c: In function `apic_mem_readl':
kvm-65/qemu/hw/apic.c:592: warning: 'val' might be used uninitialized in this function

---
 qemu/hw/apic.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
qemu/hw/apic.c +0 -0
index 4102493..b69ad75 100644

qemu/hw/apic.c static uint32_t apic_mem_readl(void *opaque, target_phys_addr_t addr) · line 622

Quoted 7 lines
qemu/hw/apic.c +1 -0
@@ -616,6 +616,7 @@ static uint32_t apic_mem_readl(void *opaque, target_phys_addr_t addr)
         val = apic_get_ppr(s);
         break;
     case 0x0b:
+        val = 0;
         break;
     case 0x0d:
         val = s->log_dest << 24;

The equivalent of commit 64173d009c1f4d163c425b14aa650df5b982428a in qemu has been done this way. So a merge of qemu SVN should fix this problem.

Signature · 10 lines
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   [email protected]         | [email protected]
   `-    people.debian.org/~aurel32 | www.aurel32.net

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Register now and save $200. Hurry, offer ends at 11:59 p.m., 
Monday, April 7! Use priority code J8TLD2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone