Commit 88693f77 authored by Yang Yingliang's avatar Yang Yingliang Committed by Greg Kroah-Hartman

usb: gadget: hid: fix error return code in hid_bind()

Fix to return a negative error code from the error handling
case instead of 0.
Reported-by: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20210618043835.2641360-1-yangyingliang@huawei.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4249d6fb
...@@ -171,8 +171,10 @@ static int hid_bind(struct usb_composite_dev *cdev) ...@@ -171,8 +171,10 @@ static int hid_bind(struct usb_composite_dev *cdev)
struct usb_descriptor_header *usb_desc; struct usb_descriptor_header *usb_desc;
usb_desc = usb_otg_descriptor_alloc(gadget); usb_desc = usb_otg_descriptor_alloc(gadget);
if (!usb_desc) if (!usb_desc) {
status = -ENOMEM;
goto put; goto put;
}
usb_otg_descriptor_init(gadget, usb_desc); usb_otg_descriptor_init(gadget, usb_desc);
otg_desc[0] = usb_desc; otg_desc[0] = usb_desc;
otg_desc[1] = NULL; otg_desc[1] = NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment