linux/drivers/usb/gadget/function
Pratham Pratap dd63f6f0d9 usb: gadget: f_uac2: Fix incorrect increment of bNumEndpoints
commit 2fa89458af upstream.

Currently connect/disconnect of USB cable calls afunc_bind and
eventually increments the bNumEndpoints. Performing multiple
plugin/plugout will increment bNumEndpoints incorrectly, and on
the next plug-in it leads to invalid configuration of descriptor
and hence enumeration fails.

Fix this by resetting the value of bNumEndpoints to 1 on every
afunc_bind call.

Fixes: 40c73b3054 ("usb: gadget: f_uac2: add adaptive sync support for capture")
Cc: stable <stable@kernel.org>
Signed-off-by: Pratham Pratap <quic_ppratap@quicinc.com>
Signed-off-by: Prashanth K <quic_prashk@quicinc.com>
Link: https://lore.kernel.org/r/1674631645-28888-1-git-send-email-quic_prashk@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-02-09 11:28:21 +01:00
..
f_acm.c USB: gadget: f_acm: use CDC defines 2022-07-25 10:57:42 +02:00
f_ecm.c
f_eem.c
f_fs.c usb: gadget: f_fs: Fix unbalanced spinlock in __ffs_ep0_queue_wait 2023-02-09 11:28:14 +01:00
f_hid.c usb: gadget: f_hid: fix refcount leak on error path 2022-12-31 13:32:41 +01:00
f_loopback.c
f_mass_storage.c USB: gadget: f_mass_storage: get rid of DEVICE_ATTR() usage 2022-08-19 11:05:58 +02:00
f_mass_storage.h
f_midi.c
f_ncm.c usb: gadget: f_ncm: fix potential NULL ptr deref in ncm_bitrate() 2023-01-24 07:24:38 +01:00
f_obex.c
f_phonet.c
f_printer.c usb: gadget: function: fix dangling pnp_string in f_printer.c 2022-09-22 15:52:29 +02:00
f_rndis.c
f_serial.c
f_sourcesink.c
f_subset.c
f_tcm.c usb: gadget: add _init/__exit annotations to module init/exit funcs 2022-09-22 15:52:29 +02:00
f_uac1_legacy.c
f_uac1.c
f_uac2.c usb: gadget: f_uac2: Fix incorrect increment of bNumEndpoints 2023-02-09 11:28:21 +01:00
f_uvc.c usb: gadget: uvc: Prevent buffer overflow in setup handler 2022-12-21 17:48:06 +01:00
f_uvc.h
g_zero.h
Makefile
ndis.h
rndis.c usb: gadget: function: rndis: limit # of RNDIS instances to 1000 2022-08-31 09:07:52 +02:00
rndis.h
storage_common.c usb: gadget: mass_storage: Fix cdrom data transfers on MAC-OS 2022-08-30 15:33:12 +02:00
storage_common.h usb: gadget: f_mass_storage: forced_eject attribute 2022-07-14 16:06:42 +02:00
tcm.h
u_audio.c
u_audio.h
u_ecm.h
u_eem.h
u_ether_configfs.h
u_ether.c usb: move from strlcpy with unused retval to strscpy 2022-08-19 11:08:54 +02:00
u_ether.h
u_fs.h
u_gether.h
u_hid.h
u_midi.h
u_ncm.h
u_phonet.h
u_printer.h
u_rndis.h
u_serial.c usb: gadget: add _init/__exit annotations to module init/exit funcs 2022-09-22 15:52:29 +02:00
u_serial.h
u_tcm.h
u_uac1_legacy.c usb: gadget: Replace runtime->status->state reference to runtime->state 2022-09-27 08:49:52 +02:00
u_uac1_legacy.h
u_uac1.h
u_uac2.h
u_uvc.h
uac_common.h
uvc_configfs.c usb: gadget: uvc: fix changing interface name via configfs 2022-07-08 14:58:25 +02:00
uvc_configfs.h
uvc_queue.c Revert "usb: gadget: uvc: limit isoc_sg to super speed gadgets" 2022-10-26 14:09:06 +02:00
uvc_queue.h
uvc_v4l2.c usb: gadget: uvc: also use try_format in set_format 2022-11-22 16:50:22 +01:00
uvc_v4l2.h
uvc_video.c Revert "usb: gadget: uvc: limit isoc_sg to super speed gadgets" 2022-10-26 14:09:06 +02:00
uvc_video.h
uvc.h usb: gadget: uvc: add v4l2 enumeration api calls 2022-09-22 15:52:30 +02:00