Skip to contentSkip to conversation

libxl: build fix

PATCH New Christoph Egger 1 participant 1 message Dec 15, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libxl: build fix

Hi!

Move variable defintion and usage to where it is actually used. Fixes build error about used initialized.

Signature · 6 lines
---to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Einsteinring 24, 85609 Dornach b. Muenchen
Geschaeftsfuehrer: Alberto Bozzo, Andrew Bowd
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632
tools/libxl/libxl.c +2 -2
diff -r 8a3f14eda1c5 -r 1044405ba1d1 tools/libxl/libxl.c
@@ -1256,7 +1256,6 @@ static char ** libxl_build_device_model_
     int num = 0, i;
     flexarray_t *dm_args;
     int nb;
-    libxl_device_disk *disks;
 
     dm_args = flexarray_make(16, 1);
     if (!dm_args)
@@ -1391,6 +1390,7 @@ static char ** libxl_build_device_model_
         flexarray_set(dm_args, num++, "xenfv");
 
     if (info->type == XENFV) {
+        libxl_device_disk *disks;
         disks = libxl_device_disk_list(libxl__gc_owner(gc), info->domid, &nb);
         for (i; i < nb; i++) {
             if (disks[i].is_cdrom) {
@@ -1402,8 +1402,8 @@ static char ** libxl_build_device_model_
             }
             libxl_device_disk_destroy(&disks[i]);
         }
+        free(disks);
     }
-    free(disks);
     flexarray_set(dm_args, num++, NULL);
     return (char **) flexarray_contents(dm_args);
 }

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel