]> rtime.felk.cvut.cz Git - hercules2020/nv-tegra/linux-4.4.git/commitdiff
usb: gadget: f_fs: Fix wrong check on reserved1 of OS_DESC_EXT_COMPAT
authorJim Lin <jilin@nvidia.com>
Fri, 20 May 2016 10:13:19 +0000 (18:13 +0800)
committermobile promotions <svcmobile_promotions@nvidia.com>
Fri, 2 Sep 2016 20:44:05 +0000 (13:44 -0700)
Current __ffs_data_do_os_desc() of f_fs.c will check reserved1 field
of OS_DESC_EXT_COMPAT and return -EINVAL if it's 1.
But MS OS 1.0 Descriptors
http://msdn.microsoft.com/en-us/library/windows/hardware/gg463179.aspx
defines that field to be 1.

Signed-off-by: Jim Lin <jilin@nvidia.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Bug 200228751

Change-Id: I0ea31dff17d9c9406ed2558d3d7d2c29770b4859
Signed-off-by: Jinyoung Park <jinyoungp@nvidia.com>
Reviewed-on: http://git-master/r/1206812
Reviewed-by: Mark Kuo <mkuo@nvidia.com>
Reviewed-by: Hans Yang <hansy@nvidia.com>
Reviewed-by: Jubeom Kim <jubeomk@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>
drivers/usb/gadget/function/f_fs.c

index 5494d953c11f1c636218ec1438b50abb54ce743f..a0ade0a1877d56424c2972a9397406f75572ff78 100644 (file)
@@ -2065,7 +2065,7 @@ static int __ffs_data_do_os_desc(enum ffs_os_desc_type type,
 
                if (len < sizeof(*d) ||
                    d->bFirstInterfaceNumber >= ffs->interfaces_count ||
-                   d->Reserved1)
+                   !d->Reserved1)
                        return -EINVAL;
                for (i = 0; i < ARRAY_SIZE(d->Reserved2); ++i)
                        if (d->Reserved2[i])