mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
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: Oleg Drokin <[email protected]> Acked-by: Thomas Renninger <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
This commit is contained in:
parent
f6cede5b49
commit
1b6e75ee29
1 changed files with 3 additions and 0 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue