Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1628739
| From | Jérémy Lefaure <jeremy.lefaure@lse.epita.fr> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH] platform/x86: asus-wmi: fix cpufv sysfs file permission |
| Date | 2017-04-22 04:30 +0200 |
| Message-ID | <tySYa-5pV-3@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
The cpufv sysfs file is defined as readable by anyone even if the
attribute does not have a show function. The result of every read is an
IO error. This file should be write only.
Signed-off-by: Jérémy Lefaure <jeremy.lefaure@lse.epita.fr>
---
drivers/platform/x86/asus-wmi.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index 8499d3ae4257..0ace471cb700 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -1761,7 +1761,7 @@ ASUS_WMI_CREATE_DEVICE_ATTR(cardr, 0644, ASUS_WMI_DEVID_CARDREADER);
ASUS_WMI_CREATE_DEVICE_ATTR(lid_resume, 0644, ASUS_WMI_DEVID_LID_RESUME);
ASUS_WMI_CREATE_DEVICE_ATTR(als_enable, 0644, ASUS_WMI_DEVID_ALS_ENABLE);
-static ssize_t store_cpufv(struct device *dev, struct device_attribute *attr,
+static ssize_t cpufv_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{
int value, rv;
@@ -1778,7 +1778,7 @@ static ssize_t store_cpufv(struct device *dev, struct device_attribute *attr,
return count;
}
-static DEVICE_ATTR(cpufv, S_IRUGO | S_IWUSR, NULL, store_cpufv);
+static DEVICE_ATTR_WO(cpufv);
static struct attribute *platform_attributes[] = {
&dev_attr_cpufv.attr,
--
2.12.2
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH] platform/x86: asus-wmi: fix cpufv sysfs file permission Jérémy Lefaure <jeremy.lefaure@lse.epita.fr> - 2017-04-22 04:30 +0200
Re: [PATCH] platform/x86: asus-wmi: fix cpufv sysfs file permission Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-04-24 11:20 +0200
Re: [PATCH] platform/x86: asus-wmi: fix cpufv sysfs file permission Jérémy Lefaure <jeremy.lefaure@lse.epita.fr> - 2017-04-24 17:40 +0200
csiph-web