]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: domain: gfx: Fix shadowing of a function argument in validation
authorErik Skultety <eskultet@redhat.com>
Fri, 7 Dec 2018 14:07:37 +0000 (15:07 +0100)
committerErik Skultety <eskultet@redhat.com>
Wed, 12 Dec 2018 14:12:35 +0000 (15:12 +0100)
Since the code was never run, it would have been very hard to spot this
mistake, especially since the compiler can't really warn about it.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
src/qemu/qemu_domain.c

index 509da6bfeaf71df93b1b38b425d00b8eefe5d014..1eb0e31df0d2ea8988907a9bbfb6b5cc5c1af317 100644 (file)
@@ -5783,9 +5783,7 @@ qemuDomainDeviceDefValidateGraphics(const virDomainGraphicsDef *graphics,
     size_t i;
 
     for (i = 0; i < def->ngraphics; i++) {
-        graphics = def->graphics[i];
-
-        if (graphics->type == VIR_DOMAIN_GRAPHICS_TYPE_EGL_HEADLESS) {
+        if (def->graphics[i]->type == VIR_DOMAIN_GRAPHICS_TYPE_EGL_HEADLESS) {
             have_egl_headless = true;
             break;
         }