Message ID | 20230201132308.31523-1-quic_ugoswami@quicinc.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 89e7252d6c7e7eeb31971cd7df987316ecc64ff5 |
Headers | show |
Series | [v3] usb: gadget: configfs: Restrict symlink creation is UDC already binded | expand |
diff --git a/drivers/usb/gadget/configfs.c b/drivers/usb/gadget/configfs.c index 78e7353e397b..a90165184c60 100644 --- a/drivers/usb/gadget/configfs.c +++ b/drivers/usb/gadget/configfs.c @@ -437,6 +437,12 @@ static int config_usb_cfg_link( * from another gadget or a random directory. * Also a function instance can only be linked once. */ + + if (gi->composite.gadget_driver.udc_name) { + ret = -EINVAL; + goto out; + } + list_for_each_entry(iter, &gi->available_func, cfs_list) { if (iter != fi) continue;