summaryrefslogtreecommitdiffstats
path: root/tools/usb/usbip/libsrc/usbip_device_driver.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2018-02-17 11:39:28 +0100
committerIngo Molnar <mingo@kernel.org>2018-02-17 11:39:28 +0100
commit7057bb975dab827997e0ca9dd92cafef0856b0cc (patch)
tree7784dc59c03f25b6bc4fa5cc12d5b61cb8b53765 /tools/usb/usbip/libsrc/usbip_device_driver.c
parent33ea4b24277b06dbc55d7f5772a46f029600255e (diff)
parent297f9233b53a08fd457815e19f1d6f2c3389857b (diff)
downloadlinux-7057bb975dab827997e0ca9dd92cafef0856b0cc.tar.gz
linux-7057bb975dab827997e0ca9dd92cafef0856b0cc.tar.bz2
linux-7057bb975dab827997e0ca9dd92cafef0856b0cc.zip
Merge branch 'perf/urgent' into perf/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/usb/usbip/libsrc/usbip_device_driver.c')
-rw-r--r--tools/usb/usbip/libsrc/usbip_device_driver.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/usb/usbip/libsrc/usbip_device_driver.c b/tools/usb/usbip/libsrc/usbip_device_driver.c
index e059b7d1ec5b..ec3a0b794f15 100644
--- a/tools/usb/usbip/libsrc/usbip_device_driver.c
+++ b/tools/usb/usbip/libsrc/usbip_device_driver.c
@@ -77,7 +77,7 @@ int read_usb_vudc_device(struct udev_device *sdev, struct usbip_usb_device *dev)
const char *path, *name;
char filepath[SYSFS_PATH_MAX];
struct usb_device_descriptor descr;
- unsigned i;
+ unsigned int i;
FILE *fd = NULL;
struct udev_device *plat;
const char *speed;
@@ -92,7 +92,7 @@ int read_usb_vudc_device(struct udev_device *sdev, struct usbip_usb_device *dev)
return -1;
ret = fread((char *) &descr, sizeof(descr), 1, fd);
if (ret < 0)
- return -1;
+ goto err;
fclose(fd);
copy_descr_attr(dev, &descr, bDeviceClass);
@@ -124,6 +124,9 @@ int read_usb_vudc_device(struct udev_device *sdev, struct usbip_usb_device *dev)
name = udev_device_get_sysname(plat);
strncpy(dev->busid, name, SYSFS_BUS_ID_SIZE);
return 0;
+err:
+ fclose(fd);
+ return -1;
}
static int is_my_device(struct udev_device *dev)