diff options
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/core/message.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c index 293a30d78d24..30a0690f3683 100644 --- a/drivers/usb/core/message.c +++ b/drivers/usb/core/message.c | |||
@@ -804,18 +804,16 @@ int usb_string(struct usb_device *dev, int index, char *buf, size_t size) | |||
804 | dev_err(&dev->dev, | 804 | dev_err(&dev->dev, |
805 | "string descriptor 0 read error: %d\n", | 805 | "string descriptor 0 read error: %d\n", |
806 | err); | 806 | err); |
807 | goto errout; | ||
808 | } else if (err < 4) { | 807 | } else if (err < 4) { |
809 | dev_err(&dev->dev, "string descriptor 0 too short\n"); | 808 | dev_err(&dev->dev, "string descriptor 0 too short\n"); |
810 | err = -EINVAL; | ||
811 | goto errout; | ||
812 | } else { | 809 | } else { |
813 | dev->have_langid = 1; | ||
814 | dev->string_langid = tbuf[2] | (tbuf[3] << 8); | 810 | dev->string_langid = tbuf[2] | (tbuf[3] << 8); |
815 | /* always use the first langid listed */ | 811 | /* always use the first langid listed */ |
816 | dev_dbg(&dev->dev, "default language 0x%04x\n", | 812 | dev_dbg(&dev->dev, "default language 0x%04x\n", |
817 | dev->string_langid); | 813 | dev->string_langid); |
818 | } | 814 | } |
815 | |||
816 | dev->have_langid = 1; | ||
819 | } | 817 | } |
820 | 818 | ||
821 | err = usb_string_sub(dev, dev->string_langid, index, tbuf); | 819 | err = usb_string_sub(dev, dev->string_langid, index, tbuf); |