Commit 7adf9e3a authored by Wesley Cheng's avatar Wesley Cheng Committed by Greg Kroah-Hartman

usb: gadget: configfs: Check USB configuration before adding

Ensure that the USB gadget is able to support the configuration being
added based on the number of endpoints required from all interfaces.  This
is for accounting for any bandwidth or space limitations.
Signed-off-by: default avatarWesley Cheng <wcheng@codeaurora.org>
Link: https://lore.kernel.org/r/1625908395-5498-3-git-send-email-wcheng@codeaurora.orgSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ce7d0008
...@@ -1404,6 +1404,10 @@ static int configfs_composite_bind(struct usb_gadget *gadget, ...@@ -1404,6 +1404,10 @@ static int configfs_composite_bind(struct usb_gadget *gadget,
goto err_purge_funcs; goto err_purge_funcs;
} }
} }
ret = usb_gadget_check_config(cdev->gadget);
if (ret)
goto err_purge_funcs;
usb_ep_autoconfig_reset(cdev->gadget); usb_ep_autoconfig_reset(cdev->gadget);
} }
if (cdev->use_os_string) { if (cdev->use_os_string) {
......
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