Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1382568

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

From Michal Nazarewicz <mina86@mina86.com>
Newsgroups linux.kernel
Subject Re: [PATCH] usb: f_mass_storage: test whether thread is running before starting another
Date 2016-04-19 16:40 +0200
Message-ID <rpEYN-8k2-7@gated-at.bofh.it> (permalink)
References <rlj6y-5b8-1@gated-at.bofh.it> <rlli2-6NG-17@gated-at.bofh.it> <rpdFh-32l-9@gated-at.bofh.it>
Organization http://mina86.com/

Show all headers | View raw


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»

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Re: [PATCH] usb: f_mass_storage: test whether thread is running before  starting another Andrzej Pietrasiewicz <andrzej.p@samsung.com> - 2016-04-18 11:30 +0200
  Re: [PATCH] usb: f_mass_storage: test whether thread is running before starting another Michal Nazarewicz <mina86@mina86.com> - 2016-04-19 16:40 +0200

csiph-web