linux/drivers/usb/gadget/function
Udipto Goswami bb03899b9b usb: gadget: f_fs: Ensure ep0req is dequeued before free_request
[ Upstream commit ce405d561b ]

As per the documentation, function usb_ep_free_request guarantees
the request will not be queued or no longer be re-queued (or
otherwise used). However, with the current implementation it
doesn't make sure that the request in ep0 isn't reused.

Fix this by dequeuing the ep0req on functionfs_unbind before
freeing the request to align with the definition.

Fixes: ddf8abd259 ("USB: f_fs: the FunctionFS driver")
Signed-off-by: Udipto Goswami <quic_ugoswami@quicinc.com>
Tested-by: Krishna Kurapati <quic_kriskura@quicinc.com>
Link: https://lore.kernel.org/r/20221215052906.8993-3-quic_ugoswami@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-02-01 08:34: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: Ensure ep0req is dequeued before free_request 2023-02-01 08:34:21 +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 superspeed transfer 2022-08-19 11:11:16 +02: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
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
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