I'd like a little more or a commit message for this. Why is such a message useful? (I agree it probably is, having at least once stumbled into a 0 length buffer myself). Anyhow, a good idea. > Signed-off-by: Manuel Stahl <manuel.stahl@xxxxxxxxxxxxxxxxx> Acked-by: Jonathan Cameron <jic23@xxxxxxxxxx> Thanks for these 3 patches Manuel, and glad to see you are active in IIO again! > --- > drivers/staging/iio/industrialio-buffer.c | 11 +++++++++++ > 1 files changed, 11 insertions(+), 0 deletions(-) > > diff --git a/drivers/staging/iio/industrialio-buffer.c b/drivers/staging/iio/industrialio-buffer.c > index f5c4999..c789d39 100644 > --- a/drivers/staging/iio/industrialio-buffer.c > +++ b/drivers/staging/iio/industrialio-buffer.c > @@ -426,6 +426,17 @@ ssize_t iio_buffer_store_enable(struct device *dev, > goto done; > } > if (requested_state) { > + if (buffer->access->get_length) { > + ret = buffer->access->get_length(buffer); > + if (ret <= 0) { > + printk(KERN_INFO > + "Buffer not started: " > + "buffer length must be greater than zero\n"); > + ret = -EINVAL; > + goto error_ret; > + } > + } > + > if (indio_dev->setup_ops->preenable) { > ret = indio_dev->setup_ops->preenable(indio_dev); > if (ret) { -- To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html