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>
Fri, 26 Nov 2021 10:40:33 +0000 (11:40 +0100)
commit1dde865a0eee05769ac78ee67441530aff4fe625
tree618932cc938aaf52eff424ec7a1677177bbce330
parent7a78a671a93c866b1abc8c0bb999b7b15a17e612
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