summaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/configfs.c
diff options
context:
space:
mode:
authorWesley Cheng <wcheng@codeaurora.org>2021-07-10 02:13:11 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-07-12 09:37:25 +0200
commit7adf9e3adc398e5d5b7af91e5fdfafa70e86dd36 (patch)
treea802d865c7b1f552efde06231d27c92a6300d2ac /drivers/usb/gadget/configfs.c
parentce7d0008c2356626f69f37ef1afce8fbc83fe142 (diff)
downloadlinux-7adf9e3adc398e5d5b7af91e5fdfafa70e86dd36.tar.bz2
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: Wesley Cheng <wcheng@codeaurora.org> Link: https://lore.kernel.org/r/1625908395-5498-3-git-send-email-wcheng@codeaurora.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/gadget/configfs.c')
-rw-r--r--drivers/usb/gadget/configfs.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/usb/gadget/configfs.c b/drivers/usb/gadget/configfs.c
index 15a607ccef8a..f4c7c8241fe2 100644
--- a/drivers/usb/gadget/configfs.c
+++ b/drivers/usb/gadget/configfs.c
@@ -1404,6 +1404,10 @@ static int configfs_composite_bind(struct usb_gadget *gadget,
goto err_purge_funcs;
}
}
+ ret = usb_gadget_check_config(cdev->gadget);
+ if (ret)
+ goto err_purge_funcs;
+
usb_ep_autoconfig_reset(cdev->gadget);
}
if (cdev->use_os_string) {