diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-08-23 16:34:43 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-08-27 12:50:53 -0700 |
commit | ce26bd23d4ad180883f53709f9a2220dc771c030 (patch) | |
tree | 3402bdee198548f7ef41cc48ffc31c9e017323fa /drivers/usb/gadget/dummy_hcd.c | |
parent | 154547c4fe0fbe92185e69a6cdc2b0502b361995 (diff) | |
download | lwn-ce26bd23d4ad180883f53709f9a2220dc771c030.tar.gz lwn-ce26bd23d4ad180883f53709f9a2220dc771c030.zip |
USB: gadget: audit sysfs attribute permissions
Convert all USB gadget sysfs attributes to use the _RO or _RW variants,
to make them easier to audit and ensure that the permissions are
correct.
Note, two are left using the DEVICE_ATTR() macro, as there is no
DEVICE_ATTR_WO() in Linus's tree, that will happen after 3.12-rc1 is
out, a follow-on patch will be sent then.
Reviewed-by: Felipe Balbi <balbi@ti.com>
Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
--
drivers/usb/gadget/composite.c | 8 +++-----
drivers/usb/gadget/dummy_hcd.c | 8 ++++----
drivers/usb/gadget/f_mass_storage.c | 14 ++++++--------
drivers/usb/gadget/net2272.c | 4 ++--
drivers/usb/gadget/net2280.c | 18 +++++++++---------
drivers/usb/gadget/storage_common.c | 25 ++++++++++++-------------
drivers/usb/gadget/udc-core.c | 14 +++++++-------
7 files changed, 43 insertions(+), 48 deletions(-)
Diffstat (limited to 'drivers/usb/gadget/dummy_hcd.c')
-rw-r--r-- | drivers/usb/gadget/dummy_hcd.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c index c588e8e486e5..06ecd08fd57a 100644 --- a/drivers/usb/gadget/dummy_hcd.c +++ b/drivers/usb/gadget/dummy_hcd.c @@ -868,7 +868,7 @@ static const struct usb_gadget_ops dummy_ops = { /*-------------------------------------------------------------------------*/ /* "function" sysfs attribute */ -static ssize_t show_function(struct device *dev, struct device_attribute *attr, +static ssize_t function_show(struct device *dev, struct device_attribute *attr, char *buf) { struct dummy *dum = gadget_dev_to_dummy(dev); @@ -877,7 +877,7 @@ static ssize_t show_function(struct device *dev, struct device_attribute *attr, return 0; return scnprintf(buf, PAGE_SIZE, "%s\n", dum->driver->function); } -static DEVICE_ATTR(function, S_IRUGO, show_function, NULL); +static DEVICE_ATTR_RO(function); /*-------------------------------------------------------------------------*/ @@ -2290,7 +2290,7 @@ static inline ssize_t show_urb(char *buf, size_t size, struct urb *urb) urb->actual_length, urb->transfer_buffer_length); } -static ssize_t show_urbs(struct device *dev, struct device_attribute *attr, +static ssize_t urbs_show(struct device *dev, struct device_attribute *attr, char *buf) { struct usb_hcd *hcd = dev_get_drvdata(dev); @@ -2311,7 +2311,7 @@ static ssize_t show_urbs(struct device *dev, struct device_attribute *attr, return size; } -static DEVICE_ATTR(urbs, S_IRUGO, show_urbs, NULL); +static DEVICE_ATTR_RO(urbs); static int dummy_start_ss(struct dummy_hcd *dum_hcd) { |