From 6c4bf5aec69f757d1cf7e76043b460e83317e2f4 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 4 Apr 2016 15:18:03 +0100 Subject: [PATCH] libxl: Set rc on failure of usbdev_busaddr_to_busid We must set rc before using `goto out'. Bug introduced in bf7628f0 "libxl: add pvusb API". CID: 1358113 Signed-off-by: Ian Jackson CC: coverity@xenproject.org CC: Simon Cao CC: George Dunlap Reviewed-by: Chunyan Liu --- tools/libxl/libxl_pvusb.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/libxl/libxl_pvusb.c b/tools/libxl/libxl_pvusb.c index f69792a12c..07030a4bc3 100644 --- a/tools/libxl/libxl_pvusb.c +++ b/tools/libxl/libxl_pvusb.c @@ -964,6 +964,7 @@ static int libxl__device_usbdev_add_xenstore(libxl__gc *gc, uint32_t domid, usbdev->u.hostdev.hostaddr); if (!busid) { LOG(DEBUG, "Fail to get busid of usb device"); + rc = ERROR_FAIL; goto out; } -- 2.30.2