Commit 1b6e75ee authored by Oleg Drokin's avatar Oleg Drokin Committed by Rafael J. Wysocki

ACPI / EC: Deny write access unless requested by module param

In debugfs it's not enough to just set file mode to read-only to
deny write access to a file, instead just don't provide
the write method unless write access is really requested.
Signed-off-by: default avatarOleg Drokin <green@linuxhacker.ru>
Acked-by: default avatarThomas Renninger <trenn@suse.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent f6cede5b
......@@ -73,6 +73,9 @@ static ssize_t acpi_ec_write_io(struct file *f, const char __user *buf,
loff_t init_off = *off;
int err = 0;
if (!write_support)
return -EINVAL;
if (*off >= EC_SPACE_SIZE)
return 0;
if (*off + count >= EC_SPACE_SIZE) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment