staging: iio: iio_ring_rip_outer return immediately if rip_lots returns <= 0
authorMichael Hennerich <michael.hennerich@analog.com>
Thu, 7 Oct 2010 11:27:37 +0000 (13:27 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 7 Oct 2010 17:06:18 +0000 (10:06 -0700)
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/iio/industrialio-ring.c

index edcf6be..d393ace 100644 (file)
@@ -105,7 +105,7 @@ static ssize_t iio_ring_rip_outer(struct file *filp, char __user *buf,
                return -EINVAL;
        copied = rb->access.rip_lots(rb, count, &data, &dead_offset);
 
-       if (copied < 0) {
+       if (copied <= 0) {
                ret = copied;
                goto error_ret;
        }