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>
This commit is contained in:
parent
35b52b3315
commit
aa8b8f9f9b
|
@ -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--;
|
||||
|
|
Loading…
Reference in New Issue