|
@@ -653,7 +653,7 @@ int usb_get_descriptor(struct usb_device *dev, unsigned char type,
|
|
|
if (result <= 0 && result != -ETIMEDOUT)
|
|
|
continue;
|
|
|
if (result > 1 && ((u8 *)buf)[1] != type) {
|
|
|
- result = -EPROTO;
|
|
|
+ result = -ENODATA;
|
|
|
continue;
|
|
|
}
|
|
|
break;
|
|
@@ -696,8 +696,13 @@ static int usb_get_string(struct usb_device *dev, unsigned short langid,
|
|
|
USB_REQ_GET_DESCRIPTOR, USB_DIR_IN,
|
|
|
(USB_DT_STRING << 8) + index, langid, buf, size,
|
|
|
USB_CTRL_GET_TIMEOUT);
|
|
|
- if (!(result == 0 || result == -EPIPE))
|
|
|
- break;
|
|
|
+ if (result == 0 || result == -EPIPE)
|
|
|
+ continue;
|
|
|
+ if (result > 1 && ((u8 *) buf)[1] != USB_DT_STRING) {
|
|
|
+ result = -ENODATA;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ break;
|
|
|
}
|
|
|
return result;
|
|
|
}
|