linux/drivers/usb/gadget
John Keeping a3acc69608 usb: f_fs: Force Reserved1=1 in OS_DESC_EXT_COMPAT
The specification says that the Reserved1 field in OS_DESC_EXT_COMPAT
must have the value "1", but when this feature was first implemented we
rejected any non-zero values.

This was adjusted to accept all non-zero values (while now rejecting
zero) in commit 53642399aa ("usb: gadget: f_fs: Fix wrong check on
reserved1 of OS_DESC_EXT_COMPAT"), but that breaks any userspace
programs that worked previously by returning EINVAL when Reserved1 == 0
which was previously the only value that succeeded!

If we just set the field to "1" ourselves, both old and new userspace
programs continue to work correctly and, as a bonus, old programs are
now compliant with the specification without having to fix anything
themselves.

Fixes: 53642399aa ("usb: gadget: f_fs: Fix wrong check on reserved1 of OS_DESC_EXT_COMPAT")
Cc: <stable@vger.kernel.org>
Signed-off-by: John Keeping <john@metanate.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
2017-11-28 13:05:31 +02:00
..
function usb: f_fs: Force Reserved1=1 in OS_DESC_EXT_COMPAT 2017-11-28 13:05:31 +02:00
legacy usb: gadget: allow to enable legacy drivers without USB_ETH 2017-11-28 13:05:07 +02:00
udc usb: gadget: core: Fix ->udc_set_speed() speed handling 2017-11-28 13:05:31 +02:00
composite.c usb: gadget: don't dereference g until after it has been null checked 2017-11-28 13:04:50 +02:00
config.c USB: gadget: Remove redundant license text 2017-11-07 15:45:02 +01:00
configfs.c A couple of configfs cleanups: 2017-11-14 14:44:04 -08:00
configfs.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
epautoconf.c USB: gadget: Remove redundant license text 2017-11-07 15:45:02 +01:00
functions.c USB: add SPDX identifiers to all remaining files in drivers/usb/ 2017-11-04 11:48:02 +01:00
Kconfig usb: gadget: allow to enable legacy drivers without USB_ETH 2017-11-28 13:05:07 +02:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
u_f.c USB: gadget: Remove redundant license text 2017-11-07 15:45:02 +01:00
u_f.h USB: gadget: Remove redundant license text 2017-11-07 15:45:02 +01:00
u_os_desc.h USB: gadget: Remove redundant license text 2017-11-07 15:45:02 +01:00
usbstring.c USB: gadget: Remove redundant license text 2017-11-07 15:45:02 +01:00