STATE_AO_GC(chs->ao) uses chs->ao before determining whether the helper is active. In the case that the helper has not been started, its ao will not have been set up.
Signed-off-by: Andrew Cooper <andrew.coop...@citrix.com> --- CC: Ian Campbell <ian.campb...@citrix.com> CC: Ian Jackson <ian.jack...@eu.citrix.com> CC: Wei Liu <wei.l...@citrix.com> IMO, this is better than the alternative of requiring that ao is unconditionally set up. It allows the other functions which explicitly shouldn't be used on a non-running helper to trip an assert() rather than limp further along. --- tools/libxl/libxl_convert_callout.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/libxl/libxl_convert_callout.c b/tools/libxl/libxl_convert_callout.c index 65b4df9..55645ba 100644 --- a/tools/libxl/libxl_convert_callout.c +++ b/tools/libxl/libxl_convert_callout.c @@ -118,10 +118,10 @@ void libxl__conversion_helper_abort(libxl__egc *egc, libxl__conversion_helper_state *chs, int rc) { - STATE_AO_GC(chs->ao); assert(rc); if (libxl__conversion_helper_inuse(chs)) { + STATE_AO_GC(chs->ao); /* A non-inuse chs doesn't have an ao. */ if (!chs->rc) chs->rc = rc; -- 1.7.10.4 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel