[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH] libxl: don't segfault when creating domain with invalid pvusb device
Creating a domain with an invalid controller specification for a pvusb device will currently segfault. Avoid this by bailing out early in case of a mandatory xenstore path not existing. Signed-of-by: Juergen Gross <jgross@xxxxxxxx> --- This patch is a backport candidate for 4.8 --- tools/libxl/libxl_usb.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tools/libxl/libxl_usb.c b/tools/libxl/libxl_usb.c index ea7a2ab..b235507 100644 --- a/tools/libxl/libxl_usb.c +++ b/tools/libxl/libxl_usb.c @@ -651,12 +651,13 @@ int libxl_device_usbctrl_getinfo(libxl_ctx *ctx, uint32_t domid, usbctrlinfo->devid = usbctrl->devid; -#define READ_SUBPATH(path, subpath) ({ \ - rc = libxl__xs_read_checked(gc, XBT_NULL, \ - GCSPRINTF("%s/" subpath, path), \ - &tmp); \ - if (rc) goto out; \ - (char *)tmp; \ +#define READ_SUBPATH(path, subpath) ({ \ + tmp = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/" subpath, path)); \ + if (!tmp) { \ + rc = ERROR_FAIL; \ + goto out; \ + } \ + (char *)tmp; \ }) #define READ_SUBPATH_INT(path, subpath) ({ \ -- 2.10.2 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |