]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.9.68/usb-gadget-f_fs-fix-extcompat-descriptor-validation.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.9.68 / usb-gadget-f_fs-fix-extcompat-descriptor-validation.patch
1 From foo@baz Wed Dec 6 17:39:55 CET 2017
2 From: Vincent Pelletier <plr.vincent@gmail.com>
3 Date: Thu, 15 Dec 2016 12:47:42 +0000
4 Subject: usb: gadget: f_fs: Fix ExtCompat descriptor validation
5
6 From: Vincent Pelletier <plr.vincent@gmail.com>
7
8
9 [ Upstream commit 354bc45bf329494ef6051f3229ef50b9e2a7ea2a ]
10
11 Reserved1 is documented as expected to be set to 0, but this test fails
12 when it it set to 0. Reverse the condition.
13
14 Signed-off-by: Vincent Pelletier <plr.vincent@gmail.com>
15 Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
16 Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
17 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
18 ---
19 drivers/usb/gadget/function/f_fs.c | 2 +-
20 1 file changed, 1 insertion(+), 1 deletion(-)
21
22 --- a/drivers/usb/gadget/function/f_fs.c
23 +++ b/drivers/usb/gadget/function/f_fs.c
24 @@ -2263,7 +2263,7 @@ static int __ffs_data_do_os_desc(enum ff
25
26 if (len < sizeof(*d) ||
27 d->bFirstInterfaceNumber >= ffs->interfaces_count ||
28 - !d->Reserved1)
29 + d->Reserved1)
30 return -EINVAL;
31 for (i = 0; i < ARRAY_SIZE(d->Reserved2); ++i)
32 if (d->Reserved2[i])