Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 280996
b: refs/heads/master
c: dc8f526
h: refs/heads/master
v: v3
  • Loading branch information
Lars-Peter Clausen authored and Greg Kroah-Hartman committed Nov 27, 2011
1 parent e8a6067 commit 28d3236
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0403e0d643809f1608448ada38a1877f26b7bf5d
refs/heads/master: dc8f52643d494eaa844002ca866d30fda142db4f
6 changes: 4 additions & 2 deletions trunk/drivers/staging/iio/industrialio-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,11 @@ static ssize_t iio_event_chrdev_read(struct file *filep,
{
struct iio_event_interface *ev_int = filep->private_data;
struct iio_detected_event_list *el;
size_t len = sizeof(el->ev);
int ret;
size_t len;

if (count < len)
return -EINVAL;

mutex_lock(&ev_int->event_list_lock);
if (list_empty(&ev_int->det_events)) {
Expand All @@ -192,7 +195,6 @@ static ssize_t iio_event_chrdev_read(struct file *filep,
el = list_first_entry(&ev_int->det_events,
struct iio_detected_event_list,
list);
len = sizeof el->ev;
if (copy_to_user(buf, &(el->ev), len)) {
ret = -EFAULT;
goto error_mutex_unlock;
Expand Down

0 comments on commit 28d3236

Please sign in to comment.