Skip to contentSkip to conversation

libxl: set rc to 0 in init_acpi_config in success path

PATCH In review Wei Liu 2 participants 2 messages Dec 16, 2016

lore
Share & tools
lore

Wei Liu

author
#0 lore raw

PATCH 1/1 libxl: set rc to 0 in init_acpi_config in success path

xc_doamin_getinfo returns >=0 in success path, and if there is no vnode configured, that rc will be returned to caller, which indicates error.

Fix that by setting rc to 0 in success path.

---
Cc: Boris Ostrovsky <[email protected]>
Cc: Ian Jackson <[email protected]>

Please squash this with "libxl: init_acpi_config should return rc in exit path" when backporting to 4.8.

---
 tools/libxl/libxl_x86_acpi.c | 1 +
 1 file changed, 1 insertion(+)
tools/libxl/libxl_x86_acpi.c +1 -0
index 6cf0c30..173188f 100644
@@ -153,6 +153,7 @@ static int init_acpi_config(libxl__gc *gc,
     config->lapic_id = acpi_lapic_id;
     config->acpi_revision = 5;
 
+    rc = 0;
 out:
     return rc;
 }
Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Tested-by on v1 1/1
#1 lore raw
Quoted 22 lines · Wei Liu

xc_doamin_getinfo returns >=0 in success path, and if there is no vnode configured, that rc will be returned to caller, which indicates error.

Fix that by setting rc to 0 in success path.

---
Cc: Boris Ostrovsky <[email protected]>
Cc: Ian Jackson <[email protected]>

Please squash this with "libxl: init_acpi_config should return rc in exit path" when backporting to 4.8.

---
 tools/libxl/libxl_x86_acpi.c | 1 +
 1 file changed, 1 insertion(+)
tools/libxl/libxl_x86_acpi.c +0 -0
index 6cf0c30..173188f 100644

tools/libxl/libxl_x86_acpi.c static int init_acpi_config(libxl__gc *gc, · line 159

Quoted 7 lines
tools/libxl/libxl_x86_acpi.c +1 -0
@@ -153,6 +153,7 @@ static int init_acpi_config(libxl__gc *gc,
     config->lapic_id = acpi_lapic_id;
     config->acpi_revision = 5;
 
+    rc = 0;
 out:
     return rc;
 }

You can also drop 'int rc = 0;' definition.

Either way,

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel