From: Huang Rui Date: Wed, 13 Nov 2013 14:35:14 +0000 (+0800) Subject: usb: usbtest: fix the bit mask of usb 2.0 extension descriptor X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=875bc23ac041519b24bd2c1faf71822e4b3e4322;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git usb: usbtest: fix the bit mask of usb 2.0 extension descriptor USB 2.1 Link PM adds to use bits[1:15] according to USB 2.0 ECN Errata for Link Power Management spec. Bit Encoding 0 Reserved 1 LPM 2 BESL & Altemate HIRD definitions supported 3 Recommended Baseline BESL valid 4 Recommended Deep BESL valid 11:8 Recommended Baseline BESL value 15:12 Recommended Deep BESL value 31:16 Reserved So fix the bit mask from 0x1e to 0xfffe. Reported-by: Sarah Sharp Signed-off-by: Huang Rui Acked-by: Felipe Balbi Acked-by: Sarah Sharp Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c index f3c31363c40a..0b5c3b157530 100644 --- a/drivers/usb/misc/usbtest.c +++ b/drivers/usb/misc/usbtest.c @@ -619,8 +619,8 @@ static int is_good_ext(struct usbtest_dev *tdev, u8 *buf) } attr = le32_to_cpu(ext->bmAttributes); - /* bits[1:4] is used and others are reserved */ - if (attr & ~0x1e) { /* reserved == 0 */ + /* bits[1:15] is used and others are reserved */ + if (attr & ~0xfffe) { /* reserved == 0 */ ERROR(tdev, "reserved bits set\n"); return 0; }