The assert(info) is after quite a lot of manipulations
on 'info' - which makes the assert pointless because if
info was NULL it would have crashed earlier.

Move it earlier so that it guards before we try using
the 'info' structure.

CC: Wen Congyang <we...@cn.fujitsu.com>
CC: Yang Hongyang <hongyang.y...@easystack.cn>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.w...@oracle.com>
---
 tools/libxl/libxl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 2bde0f5..60974cc 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -855,6 +855,8 @@ int libxl_domain_remus_start(libxl_ctx *ctx, 
libxl_domain_remus_info *info,
         goto out;
     }
 
+    assert(info);
+
     libxl_defbool_setdefault(&info->allow_unsafe, false);
     libxl_defbool_setdefault(&info->blackhole, false);
     libxl_defbool_setdefault(&info->compression, true);
@@ -883,8 +885,6 @@ int libxl_domain_remus_start(libxl_ctx *ctx, 
libxl_domain_remus_info *info,
     dss->debug = 0;
     dss->remus = info;
 
-    assert(info);
-
     /* Point of no return */
     libxl__remus_setup(egc, dss);
     return AO_INPROGRESS;
-- 
2.4.3


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

Reply via email to