Skip to contentSkip to conversation

qxl: lock current_async update in qxl_soft_reset

PATCH In review Gerd Hoffmann 2 participants 2 messages Oct 20, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qxl: lock current_async update in qxl_soft_reset

---
 hw/display/qxl.c | 2 ++
 1 file changed, 2 insertions(+)
hw/display/qxl.c +2 -0
index 9c961da..20dc72e 100644
@@ -1156,7 +1156,9 @@ static void qxl_soft_reset(PCIQXLDevice *d)
     trace_qxl_soft_reset(d->id);
     qxl_check_state(d);
     qxl_clear_guest_bug(d);
+    qemu_mutex_lock(&d->async_lock);
     d->current_async = QXL_UNDEFINED_IO;
+    qemu_mutex_unlock(&d->async_lock);
 
     if (d->id == 0) {
         qxl_enter_vga_mode(d);
Signature · 1 line
1.8.3.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 12 lines · Gerd Hoffmann
---
 hw/display/qxl.c | 2 ++
 1 file changed, 2 insertions(+)
hw/display/qxl.c +0 -0
index 9c961da..20dc72e 100644

hw/display/qxl.c static void qxl_soft_reset(PCIQXLDevice *d) · line 1164

Quoted 9 lines
hw/display/qxl.c +2 -0
@@ -1156,7 +1156,9 @@ static void qxl_soft_reset(PCIQXLDevice *d)
     trace_qxl_soft_reset(d->id);
     qxl_check_state(d);
     qxl_clear_guest_bug(d);
+    qemu_mutex_lock(&d->async_lock);
     d->current_async = QXL_UNDEFINED_IO;
+    qemu_mutex_unlock(&d->async_lock);
 
     if (d->id == 0) {
         qxl_enter_vga_mode(d);

Thanks, this should fix a defect report from Coverity.