summaryrefslogtreecommitdiffstats
path: root/drivers/acpi/ec_sys.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/ec_sys.c')
-rw-r--r--drivers/acpi/ec_sys.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/acpi/ec_sys.c b/drivers/acpi/ec_sys.c
index bea8e425a8de..6c7dd7af789e 100644
--- a/drivers/acpi/ec_sys.c
+++ b/drivers/acpi/ec_sys.c
@@ -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) {