From: Michael Hennerich Date: Thu, 7 Oct 2010 11:27:37 +0000 (+0200) Subject: staging: iio: iio_ring_rip_outer return immediately if rip_lots returns <= 0 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=d0a530441ea9f2f10172c7f31a007f6b23d3fc19;p=linux-beck.git staging: iio: iio_ring_rip_outer return immediately if rip_lots returns <= 0 Acked-by: Jonathan Cameron Signed-off-by: Michael Hennerich Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/iio/industrialio-ring.c b/drivers/staging/iio/industrialio-ring.c index edcf6be99ccb..d393ace0b41b 100644 --- a/drivers/staging/iio/industrialio-ring.c +++ b/drivers/staging/iio/industrialio-ring.c @@ -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; }