Re: [PATCH] usb: f_mass_storage: test whether thread is running before starting another

From: Michal Nazarewicz
Date: Tue Apr 19 2016 - 10:38:49 EST


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Â