Commit aa8b8f9f authored by Nick Crews's avatar Nick Crews Committed by Enric Balletbo i Serra

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: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarNick Crews <ncrews@chromium.org>
Signed-off-by: default avatarEnric Balletbo i Serra <enric.balletbo@collabora.com>
parent 35b52b33
......@@ -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--;
......
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