tools/libxenctrl: fix error check after opening libxenforeignmemory
authorPaul Durrant <paul.durrant@citrix.com>
Wed, 22 Feb 2017 13:27:34 +0000 (13:27 +0000)
committerWei Liu <wei.liu2@citrix.com>
Wed, 22 Feb 2017 14:27:22 +0000 (14:27 +0000)
Checking the value of xch->xcall is clearly incorrect. The code should be
checking xch->fmem (i.e. the return of the previously called function).

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxc/xc_private.c

index f0e089c704454975a31bf0c9bfbd680b9c513611..9df69253f5047ec916deadec0d665dae7102e928 100644 (file)
@@ -64,8 +64,7 @@ struct xc_interface_core *xc_interface_open(xentoollog_logger *logger,
         goto err;
 
     xch->fmem = xenforeignmemory_open(xch->error_handler, 0);
-
-    if ( xch->xcall == NULL )
+    if ( xch->fmem == NULL )
         goto err;
 
     return xch;