usb: gadget: f_hid: fix refcount leak on error path
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: 21a9476a ("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.comSigned-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Showing
Please register or sign in to comment