You've already forked linux-rockchip
mirror of
https://github.com/armbian/linux-rockchip.git
synced 2026-01-06 11:08:10 -08:00
usb: gadget: hid: fix error code in do_config()
[ Upstream commit68e7c510fd] Return an error code if usb_get_function() fails. Don't return success. Fixes:4bc8a33f24("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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
92a80e1ca2
commit
d8da6328ec
@@ -99,8 +99,10 @@ static int do_config(struct usb_configuration *c)
|
||||
|
||||
list_for_each_entry(e, &hidg_func_list, node) {
|
||||
e->f = usb_get_function(e->fi);
|
||||
if (IS_ERR(e->f))
|
||||
if (IS_ERR(e->f)) {
|
||||
status = PTR_ERR(e->f);
|
||||
goto put;
|
||||
}
|
||||
status = usb_add_function(c, e->f);
|
||||
if (status < 0) {
|
||||
usb_put_function(e->f);
|
||||
|
||||
Reference in New Issue
Block a user