linux/drivers/usb/gadget/function
Pratham Pratap 2fa89458af usb: gadget: f_uac2: Fix incorrect increment of bNumEndpoints
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-01-25 16:17:46 +01:00
..
f_acm.c USB: gadget: f_acm: use CDC defines 2022-07-25 10:57:42 +02:00
f_ecm.c usb: gadget: f_ecm: Always set current gadget in ecm_bind() 2022-11-09 12:39:33 +01:00
f_eem.c
f_fs.c usb: gadget: f_fs: Fix unbalanced spinlock in __ffs_ep0_queue_wait 2023-01-24 18:19:39 +01:00
f_hid.c usb: gadget: f_hid: tidy error handling in hidg_alloc 2022-11-29 08:56:09 +01:00
f_loopback.c
f_mass_storage.c usb: gadget: Use kstrtobool() instead of strtobool() 2022-11-03 23:46:01 +09: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-17 17:10:34 +01:00
f_obex.c
f_phonet.c usb: gadget: f_phonet: Use struct_size() helper in kzalloc() 2022-01-26 14:01:28 +01:00
f_printer.c usb: gadget: function: Simplify diagnostic messaging in printer 2022-11-29 08:56:09 +01:00
f_rndis.c
f_serial.c usb: gadget: f_serial: Ensure gserial disconnected during unbind 2022-01-26 13:57:59 +01:00
f_sourcesink.c usb: gadget: f_sourcesink: Fix isoc transfer for USB_SPEED_SUPER_PLUS 2022-01-26 13:41:53 +01:00
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 usb: gadget: f_uac1: allow changing interface name via configfs 2022-01-26 14:10:40 +01:00
f_uac2.c usb: gadget: f_uac2: Fix incorrect increment of bNumEndpoints 2023-01-25 16:17:46 +01:00
f_uvc.c usb: gadget: uvc: Prevent buffer overflow in setup handler 2022-12-08 16:44:03 +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 usb: gadget: rndis: add spinlock for rndis response list 2022-02-24 11:16:57 +01:00
storage_common.c usb: gadget: Use kstrtobool() instead of strtobool() 2022-11-03 23:46:01 +09: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 usb: gadget: u_audio: clean up some inconsistent indenting 2022-04-21 19:03:07 +02:00
u_audio.h usb: gadget: u_audio: Add suspend call 2022-01-26 14:06:09 +01:00
u_ecm.h
u_eem.h
u_ether_configfs.h
u_ether.c usb: gadget: u_ether: Do not make UDC parent of the net device 2022-11-09 12:39:33 +01: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: Use kstrtobool() instead of strtobool() 2022-11-03 23:46:01 +09: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 usb: gadget: f_uac1: allow changing interface name via configfs 2022-01-26 14:10:40 +01:00
u_uac2.h usb: gadget: f_uac2: Optionally determine bInterval for HS and SS 2022-01-31 14:26:18 +01:00
u_uvc.h usb: gadget: uvc: allow changing interface name via configfs 2022-04-21 18:14:34 +02:00
uac_common.h usb: gadget: u_audio: Support multiple sampling rates 2022-01-26 14:06:08 +01:00
uvc_configfs.c usb: gadget: uvc: Rename bmInterfaceFlags -> bmInterlaceFlags 2022-12-08 16:53:47 +01:00
uvc_configfs.h usb: gadget: uvc: track frames in format entries 2022-05-05 22:10:36 +02:00
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 usb: gadget: uvc: rework uvcg_queue_next_buffer to uvcg_complete_buffer 2022-04-21 18:15:33 +02:00
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