linux/drivers/usb/gadget/function
Kevin Groeneveld 9499327714 usb: gadget: f_uac2: fix return value for UAC2_ATTRIBUTE_STRING store
The configfs store callback should return the number of bytes consumed
not the total number of bytes we actually stored. These could differ if
for example the passed in string had a newline we did not store.

If the returned value does not match the number of bytes written the
writer might assume a failure or keep trying to write the remaining bytes.

For example the following command will hang trying to write the final
newline over and over again (tested on bash 2.05b):

  echo foo > function_name

Fixes: 993a44fa85 ("usb: gadget: f_uac2: allow changing interface name via configfs")
Cc: stable <stable@kernel.org>
Signed-off-by: Kevin Groeneveld <kgroeneveld@lenbrook.com>
Link: https://lore.kernel.org/r/20241006232637.4267-1-kgroeneveld@lenbrook.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-10-16 10:28:28 +02:00
..
f_acm.c usb: gadget: f_acm: make bInterfaceProtocol configurable 2024-09-03 09:54:16 +02:00
f_ecm.c usb: gadget: add missing MODULE_DESCRIPTION() macros 2024-06-20 19:18:19 +02:00
f_eem.c usb: gadget: add missing MODULE_DESCRIPTION() macros 2024-06-20 19:18:19 +02:00
f_fs.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
f_hid.c usb: gadget: function: move u_f.h to include/linux/usb/func_utils.h 2024-09-03 09:57:08 +02:00
f_loopback.c usb: gadget: function: move u_f.h to include/linux/usb/func_utils.h 2024-09-03 09:57:08 +02:00
f_mass_storage.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
f_mass_storage.h
f_midi2.c usb: gadget: function: move u_f.h to include/linux/usb/func_utils.h 2024-09-03 09:57:08 +02:00
f_midi.c usb: gadget: function: move u_f.h to include/linux/usb/func_utils.h 2024-09-03 09:57:08 +02:00
f_ncm.c usb: gadget: add missing MODULE_DESCRIPTION() macros 2024-06-20 19:18:19 +02:00
f_obex.c usb: gadget: add missing MODULE_DESCRIPTION() macros 2024-06-20 19:18:19 +02:00
f_phonet.c usb: gadget: add missing MODULE_DESCRIPTION() macros 2024-06-20 19:18:19 +02:00
f_printer.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
f_rndis.c usb: gadget: add missing MODULE_DESCRIPTION() macros 2024-06-20 19:18:19 +02:00
f_serial.c usb: gadget: add missing MODULE_DESCRIPTION() macros 2024-06-20 19:18:19 +02:00
f_sourcesink.c usb: gadget: function: move u_f.h to include/linux/usb/func_utils.h 2024-09-03 09:57:08 +02:00
f_subset.c usb: gadget: add missing MODULE_DESCRIPTION() macros 2024-06-20 19:18:19 +02:00
f_tcm.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
f_uac1_legacy.c usb: gadget: add missing MODULE_DESCRIPTION() macros 2024-06-20 19:18:19 +02:00
f_uac1.c usb: gadget: f_uac1: Change volume name and remove alt names 2024-08-13 18:11:35 +02:00
f_uac2.c usb: gadget: f_uac2: fix return value for UAC2_ATTRIBUTE_STRING store 2024-10-16 10:28:28 +02:00
f_uvc.c usb: gadget: add missing MODULE_DESCRIPTION() macros 2024-06-20 19:18:19 +02:00
f_uvc.h usb: gadget: uvc: prevent use of disabled endpoint 2023-11-23 12:32:44 +00:00
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 move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
rndis.h
storage_common.c usb: gadget: add missing MODULE_DESCRIPTION() macros 2024-06-20 19:18:19 +02:00
storage_common.h move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
tcm.h
u_audio.c Merge 6.11-rc3 into usb-next 2024-08-12 18:49:00 +02:00
u_audio.h
u_ecm.h
u_eem.h
u_ether_configfs.h
u_ether.c Merge 6.10-rc6 into usb-next 2024-07-01 13:59:29 +02:00
u_ether.h usb: gadget: add a inline function gether_bitrate() 2023-08-22 14:48:33 +02:00
u_fs.h
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 usb: gadget: ncm: Add support to update wMaxSegmentSize via configfs 2024-01-04 16:01:14 +01:00
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 Merge 6.11-rc3 into usb-next 2024-08-12 18:49:00 +02:00
u_serial.h usb: gadget: f_acm: make bInterfaceProtocol configurable 2024-09-03 09:54:16 +02:00
u_tcm.h
u_uac1_legacy.c
u_uac1_legacy.h
u_uac1.h usb: gadget: f_uac1: Change volume name and remove alt names 2024-08-13 18:11:35 +02:00
u_uac2.h usb: gadget: f_uac2: Expose all string descriptors through configfs. 2024-08-13 10:37:05 +02:00
u_uvc.h usb: gadget: webcam: Make g_webcam loadable again 2023-12-15 18:27:38 +01:00
uac_common.h
uvc_configfs.c Linux 6.9-rc7 2024-05-10 09:38:01 +01:00
uvc_configfs.h
uvc_queue.c
uvc_queue.h
uvc_v4l2.c usb: gadget: uvc: Fix ERR_PTR dereference in uvc_v4l2.c 2024-08-22 17:24:51 +08:00
uvc_v4l2.h
uvc_video.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
uvc_video.h usb: gadget: uvc: move video disable logic to its own function 2023-11-23 12:32:44 +00:00
uvc.h usb:gadget:uvc Do not use worker thread to pump isoc usb requests 2023-11-23 12:32:44 +00:00