linux/drivers/usb/gadget/function
Konstantin Aladyshev 61890dc28f usb: gadget: f_hid: fix report descriptor allocation
The commit 89ff3dfac6 ("usb: gadget: f_hid: fix f_hidg lifetime vs
cdev") has introduced a bug that leads to hid device corruption after
the replug operation.
Reverse device managed memory allocation for the report descriptor
to fix the issue.

Tested:
This change was tested on the AMD EthanolX CRB server with the BMC
based on the OpenBMC distribution. The BMC provides KVM functionality
via the USB gadget device:
- before: KVM page refresh results in a broken USB device,
- after: KVM page refresh works without any issues.

Fixes: 89ff3dfac6 ("usb: gadget: f_hid: fix f_hidg lifetime vs cdev")
Cc: stable@vger.kernel.org
Signed-off-by: Konstantin Aladyshev <aladyshev22@gmail.com>
Link: https://lore.kernel.org/r/20231206080744.253-2-aladyshev22@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-12-07 10:12:05 +09:00
..
f_acm.c usb: gadget: remove max support speed info in bind operation 2023-08-22 14:48:33 +02:00
f_ecm.c usb: gadget: remove max support speed info in bind operation 2023-08-22 14:48:33 +02:00
f_eem.c usb: gadget: remove max support speed info in bind operation 2023-08-22 14:48:33 +02:00
f_fs.c hardening updates for v6.7-rc1 2023-10-30 19:09:55 -10:00
f_hid.c usb: gadget: f_hid: fix report descriptor allocation 2023-12-07 10:12:05 +09:00
f_loopback.c usb: gadget: remove max support speed info in bind operation 2023-08-22 14:48:33 +02:00
f_mass_storage.c USB: gadget: f_mass_storage: Fix unused variable warning 2023-08-12 10:06:12 +02:00
f_mass_storage.h
f_midi2.c usb: gadget: unconditionally allocate hs/ss descriptor in bind operation 2023-08-22 14:48:33 +02:00
f_midi.c usb: gadget: f_midi: Annotate struct f_midi with __counted_by 2023-10-02 09:48:52 -07:00
f_ncm.c usb: gadget: f_ncm: Always set current gadget in ncm_bind() 2023-10-21 12:54:53 +02:00
f_obex.c usb: gadget: remove max support speed info in bind operation 2023-08-22 14:48:33 +02:00
f_phonet.c
f_printer.c USB: gadget: f_printer: make usb_gadget_class a static const structure 2023-06-20 16:20:47 +02:00
f_rndis.c usb: gadget: remove max support speed info in bind operation 2023-08-22 14:48:33 +02:00
f_serial.c usb: gadget: remove max support speed info in bind operation 2023-08-22 14:48:33 +02:00
f_sourcesink.c usb: gadget: remove max support speed info in bind operation 2023-08-22 14:48:33 +02:00
f_subset.c usb: gadget: remove max support speed info in bind operation 2023-08-22 14:48:33 +02:00
f_tcm.c scsi: target: Have drivers report if they support direct submissions 2023-10-13 15:53:57 -04:00
f_uac1_legacy.c
f_uac1.c
f_uac2.c usb: gadget: f_uac2: allow changing terminal types through configfs 2023-10-05 09:35:43 +02:00
f_uvc.c usb: gadget: uvc: Add missing initialization of ssp config descriptor 2023-10-28 12:25:19 +02:00
f_uvc.h
g_zero.h
Makefile usb: gadget: Add support for USB MIDI 2.0 function driver 2023-07-26 06:38:14 +02:00
ndis.h
rndis.c
rndis.h
storage_common.c
storage_common.h
tcm.h
u_audio.c usb: gadget: u_audio: don't let userspace block driver unbind 2023-03-09 14:56:32 +01:00
u_audio.h
u_ecm.h
u_eem.h
u_ether_configfs.h
u_ether.c usb: gadget: u_ether: Replace netif_stop_queue with netif_device_detach 2023-10-08 07:50:36 +02:00
u_ether.h usb: gadget: add a inline function gether_bitrate() 2023-08-22 14:48:33 +02:00
u_fs.h usb: gadget: ffs: remove ENTER() macro 2023-03-29 08:55:58 +02:00
u_gether.h
u_hid.h
u_midi2.h usb: gadget: midi2: More flexible MIDI 1.0 configuration 2023-07-26 06:38:14 +02:00
u_midi.h
u_ncm.h
u_phonet.h usb: gadget: function: Remove unused declarations 2023-08-22 14:45:29 +02:00
u_printer.h
u_rndis.h
u_serial.c tty: make tty_operations::write()'s count size_t 2023-08-11 21:12:46 +02:00
u_serial.h usb: gadget: function: Remove unused declarations 2023-08-22 14:45:29 +02:00
u_tcm.h
u_uac1_legacy.c
u_uac1_legacy.h
u_uac1.h
u_uac2.h usb: gadget: f_uac2: allow changing terminal types through configfs 2023-10-05 09:35:43 +02:00
u_uvc.h usb: gadget: uvc: Allow linking function to string descs 2023-02-07 08:46:37 +01:00
uac_common.h
uvc_configfs.c usb: gadget: uvc: Make bmControls attr read/write 2023-03-29 08:51:26 +02:00
uvc_configfs.h usb: gadget: uvc: Allow linking XUs to string descriptors 2023-02-07 08:46:37 +01:00
uvc_queue.c
uvc_queue.h
uvc_v4l2.c usb: uvc: use v4l2_fill_fmtdesc instead of open coded format name 2023-01-31 09:40:43 +01:00
uvc_v4l2.h
uvc_video.c Revert "usb: gadget: uvc: stop pump thread on video disable" 2023-10-05 10:52:41 +02:00
uvc_video.h
uvc.h usb: gadget: function: Remove unused declarations 2023-08-22 14:45:29 +02:00