usb: gadget: hid: fix error code in do_config()
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 11 Oct 2021 12:37:39 +0000 (15:37 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Nov 2021 18:16:51 +0000 (19:16 +0100)
commit82012f8f4926d33df5a8c670d9c1211a395560dc
tree6c3fff26ec296833d8df26a6b794626f98cc3489
parent64b913c6d40a8f90e72d2a0b63cf0d5db66f8925
usb: gadget: hid: fix error code in do_config()

[ Upstream commit 68e7c510fdf4f6167404609da52e1979165649f6 ]

Return an error code if usb_get_function() fails.  Don't return success.

Fixes: 4bc8a33f2407 ("usb: gadget: hid: convert to new interface of f_hid")
Acked-by: Felipe Balbi <balbi@kernel.org>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20211011123739.GC15188@kili
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/usb/gadget/legacy/hid.c