lkml.org 
[lkml]   [2019]   [Jun]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2 1/2] platform/chrome: wilco_ec: Fix unreleased lock in event_read()
Date
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>
---
drivers/platform/chrome/wilco_ec/event.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

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--;
--
2.20.1
\
 
 \ /
  Last update: 2019-06-24 21:02    [W:0.034 / U:3.856 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site