lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8737vajjy7.fsf@saruman.tx.rr.com>
Date:	Thu, 10 Dec 2015 11:24:16 -0600
From:	Felipe Balbi <balbi@...com>
To:	<changbin.du@...el.com>
CC:	<gregkh@...uxfoundation.org>, <John.Youn@...opsys.com>,
	<linux-usb@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
	"Du, Changbin" <changbin.du@...el.com>
Subject: Re: [PATCH] usb: gadget: make usb_ep_enable return -EBUSY if ep has already enabled


Hi,

changbin.du@...el.com writes:
> From: "Du, Changbin" <changbin.du@...el.com>
>
> When usb_ep_enable on a enabled ep, the configuration of the ep probably
> has changed. In this scenario, the ep configuration in hw should be
> reprogrammed by udc driver. Hence, it is better to return an error to
> inform the caller.
>
> Signed-off-by: Du, Changbin <changbin.du@...el.com>
> ---
>  include/linux/usb/gadget.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
> index d813bd2..89f9fdd 100644
> --- a/include/linux/usb/gadget.h
> +++ b/include/linux/usb/gadget.h
> @@ -268,7 +268,7 @@ static inline int usb_ep_enable(struct usb_ep *ep)
>  	int ret;
>  
>  	if (ep->enabled)
> -		return 0;
> +		return -EBUSY;

While at that, can you add a WARN_ON() as well ?

	if (WARN_ON(ep->enabled))
        	return -EBUSY;

-- 
balbi

Download attachment "signature.asc" of type "application/pgp-signature" (819 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ