On Fri, Oct 28, 2016 at 10:33:19PM +0200, Julia Lawall wrote:
> 
> 
> On Fri, 28 Oct 2016, Julia Lawall wrote:
> 
> > The file drivers/usb/musb/musb_core.c contains the code:
> >
> > static DEVICE_ATTR(srp, 0644, NULL, musb_srp_store);
> >
> > Is it correct to have NULL in the third argument for an attribute that can
> > be read?  Should the permission be 0444 instead?
> 
> Sorry, I got that backwards.  Should the permission be 0200?

Even better yet, it should be using DEVICE_ATTR_WO() to be explicit and
make it impossible to get wrong.

Unless this file is set up this way for userspace to later change the
permission so that others can write to it?  I don't know the history
here...

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to