mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 02:30:03 +01:00
ocaml/xenctrl: Check return values from hypercalls
rather than blindly continuing and possibly using negative values. Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> CC: Ian Campbell <Ian.Campbell@citrix.com> CC: Ian Jackson <Ian.Jackson@eu.citrix.com> CC: Wei Liu <wei.liu2@citrix.com> CC: Dave Scott <dave.scott@eu.citrix.com> Acked-by: David Scott <dave.scott@citrix.com> (cherry picked from commit3380f5b627) (cherry picked from commitc91ed889ea) (cherry picked from commit10a95535b0)
This commit is contained in:
1 parent
0332b3f24b
commit
8d0ca8a5e1
1 file changed
+9
@@ -455,6 +455,9 @@ CAMLprim value stub_xc_vcpu_getaffinity(value xch, value domid,
|
||||
int i, len = xc_get_max_cpus(_H(xch));
|
||||
int retval;
|
||||
|
||||
if (len < 1)
|
||||
failwith_xc(_H(xch));
|
||||
|
||||
c_cpumap = xc_cpumap_alloc(_H(xch));
|
||||
if (c_cpumap == NULL)
|
||||
failwith_xc(_H(xch));
|
||||
@@ -805,6 +808,12 @@ CAMLprim value stub_xc_version_version(value xch)
|
||||
|
||||
caml_enter_blocking_section();
|
||||
packed = xc_version(_H(xch), XENVER_version, NULL);
|
||||
caml_leave_blocking_section();
|
||||
|
||||
if (packed < 0)
|
||||
failwith_xc(_H(xch));
|
||||
|
||||
caml_enter_blocking_section();
|
||||
retval = xc_version(_H(xch), XENVER_extraversion, &extra);
|
||||
caml_leave_blocking_section();
|
||||
|
||||
|
||||