linux-stable/drivers/usb/gadget
John Keeping ba78f7c106 usb: gadget: f_hid: fix refcount leak on error path
[ Upstream commit 70a3288a75 ]

When failing to allocate report_desc, opts->refcnt has already been
incremented so it needs to be decremented to avoid leaving the options
structure permanently locked.

Fixes: 21a9476a7b ("usb: gadget: hid: add configfs support")
Tested-by: Lee Jones <lee@kernel.org>
Reviewed-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
Reviewed-by: Lee Jones <lee@kernel.org>
Signed-off-by: John Keeping <john@metanate.com>
Link: https://lore.kernel.org/r/20221122123523.3068034-3-john@metanate.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-12-31 13:26:27 +01:00
..
function usb: gadget: f_hid: fix refcount leak on error path 2022-12-31 13:26:27 +01:00
legacy gadgetfs: ep_io - wait until IRQ finishes 2022-07-08 14:50:43 +02:00
udc USB: gadget: Fix use-after-free during usb config switch 2022-12-31 13:26:25 +01:00
Kconfig media: Kconfig: cleanup VIDEO_DEV dependencies 2022-03-18 05:58:35 +01:00
Makefile usb: gadget: Makefile: remove ccflags-y 2022-03-18 12:56:08 +01:00
composite.c USB: gadget: Rename usb_gadget_probe_driver() 2022-04-26 14:00:13 +02:00
config.c
configfs.c Linux 5.18-rc5 2022-05-03 16:35:26 +02:00
configfs.h
epautoconf.c usb: gadget: fix for a typo that conveys logically-inverted information. 2021-09-14 10:27:54 +02:00
functions.c
u_f.c
u_f.h
u_os_desc.h
usbstring.c