[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH v2 2/3] libxl: use libxl__read_xenstore_mandatory in vdispl function



Coverity-ID: 1418097

Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
---
 tools/libxl/libxl_vdispl.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/libxl_vdispl.c b/tools/libxl/libxl_vdispl.c
index 5740c89fad..befc56bdeb 100644
--- a/tools/libxl/libxl_vdispl.c
+++ b/tools/libxl/libxl_vdispl.c
@@ -40,10 +40,14 @@ static int libxl__vdispl_from_xenstore(libxl__gc *gc, const 
char *libxl_path,
                                        libxl_devid devid,
                                        libxl_device_vdispl *vdispl)
 {
-    char *be_path;
+    const char *be_path;
+    int rc;
 
     vdispl->devid = devid;
-    be_path = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/backend", 
libxl_path));
+    rc = libxl__xs_read_mandatory(gc, XBT_NULL,
+                                  GCSPRINTF("%s/backend", libxl_path),
+                                  &be_path);
+    if (rc) return rc;
 
     return libxl__backendpath_parse_domid(gc, be_path, &vdispl->backend_domid);
 }
-- 
2.11.0


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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.