On Mon, Apr 18 2016, Andrzej Pietrasiewicz wrote:
> The function responsible for verifying if a symlink can be made is in
> drivers/usb/gadget/configfs.c: config_usb_cfg_link()
>
> There is a comment from the author:
>
> * Also a function instance can only be linked once.
>
> This is the code fragment of interest:
>
> list_for_each_entry(f, &cfg->func_list, list) {
> if (f->fi == fi) {
> ret = -EEXIST;
> goto out;
> }
> }
Thanks for checking. This is exactly the kind of check I expected so
checking for thread not being run multiple times is enough when
configfs is in use.
Legacy gadgets may still construct crazy configurations but I’d call
that a bug in such legacy gadget.
--
Best regards
ミハウ “𝓶𝓲𝓷𝓪86” ナザレヴイツ
«If at first you don’t succeed, give up skydiving»