diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-11-04 06:41:09 +0100 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-11-04 06:41:09 +0100 |
| commit | 16c8373ecf7b3c723a8e765d798ea413bc8345a6 (patch) | |
| tree | 19684614078313ac940ce1ad744772dac71b91a6 /tools/usb/usbip/libsrc/usbip_device_driver.c | |
| parent | d19f1d44e74322ae2a75dc07b7d44fecacd5bcfb (diff) | |
| parent | a99d8080aaf358d5d23581244e5da23b35e340b9 (diff) | |
Merge 5.4-rc6 into usb-next
We need the USB fixes in here to build on top of.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/usb/usbip/libsrc/usbip_device_driver.c')
| -rw-r--r-- | tools/usb/usbip/libsrc/usbip_device_driver.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/usb/usbip/libsrc/usbip_device_driver.c b/tools/usb/usbip/libsrc/usbip_device_driver.c index 051d7d3f443b..927a151fa9aa 100644 --- a/tools/usb/usbip/libsrc/usbip_device_driver.c +++ b/tools/usb/usbip/libsrc/usbip_device_driver.c @@ -69,7 +69,7 @@ int read_usb_vudc_device(struct udev_device *sdev, struct usbip_usb_device *dev) FILE *fd = NULL; struct udev_device *plat; const char *speed; - int ret = 0; + size_t ret; plat = udev_device_get_parent(sdev); path = udev_device_get_syspath(plat); @@ -79,8 +79,10 @@ int read_usb_vudc_device(struct udev_device *sdev, struct usbip_usb_device *dev) if (!fd) return -1; ret = fread((char *) &descr, sizeof(descr), 1, fd); - if (ret < 0) + if (ret != 1) { + err("Cannot read vudc device descr file: %s", strerror(errno)); goto err; + } fclose(fd); copy_descr_attr(dev, &descr, bDeviceClass); |
