summaryrefslogtreecommitdiff
path: root/drivers/platform/chrome
diff options
context:
space:
mode:
authorNick Crews <ncrews@chromium.org>2019-06-14 14:56:31 -0600
committerEnric Balletbo i Serra <enric.balletbo@collabora.com>2019-06-18 10:37:21 +0200
commitaa8b8f9f9bef4696b6d9f1ca4d0de2b403db65c5 (patch)
tree6bec220702f152899573aef227185287bb25d3ae /drivers/platform/chrome
parent35b52b3315a21d3314f859814717ca3583660f73 (diff)
platform/chrome: wilco_ec: Fix unreleased lock in event_read()
When copying an event to userspace failed, the event queue lock was never released. This fixes that. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Nick Crews <ncrews@chromium.org> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Diffstat (limited to 'drivers/platform/chrome')
-rw-r--r--drivers/platform/chrome/wilco_ec/event.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/platform/chrome/wilco_ec/event.c b/drivers/platform/chrome/wilco_ec/event.c
index 4d2776f77dbd..1eed55681598 100644
--- a/drivers/platform/chrome/wilco_ec/event.c
+++ b/drivers/platform/chrome/wilco_ec/event.c
@@ -342,7 +342,7 @@ static ssize_t event_read(struct file *filp, char __user *buf, size_t count,
struct ec_event_entry, list);
n_bytes_written = entry->size;
if (copy_to_user(buf, &entry->event, n_bytes_written))
- return -EFAULT;
+ n_bytes_written = -EFAULT;
list_del(&entry->list);
kfree(entry);
dev_data->num_events--;