All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Linus Walleij <linus.walleij@linaro.org>, linux-iio@vger.kernel.org
Subject: Re: [RESEND PATCH 2/4] iio: percolate error if event fd fails
Date: Sun, 20 Sep 2015 11:53:29 +0100	[thread overview]
Message-ID: <55FE9029.9000302@kernel.org> (raw)
In-Reply-To: <1442303365-11811-1-git-send-email-linus.walleij@linaro.org>

On 15/09/15 08:49, Linus Walleij wrote:
> This makes the error from iio_event_getfd() percolate up
> to userspace properly so we can know for sure there is no
> events on this device (-ENODEV returned). Before this patch
> we would bail out looking for the unsupported evens on the
> erroneous (negative) file descriptor.
> 
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Hi Linus,

I applied this one a while back - will be going upstream to Greg shortly.
Got delayed I think by just missing the merge window close.

Jonathan
> ---
>  drivers/iio/industrialio-core.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c
> index b3fcc2c449d8..b347524d1b6d 100644
> --- a/drivers/iio/industrialio-core.c
> +++ b/drivers/iio/industrialio-core.c
> @@ -1153,6 +1153,8 @@ static long iio_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
>  
>  	if (cmd == IIO_GET_EVENT_FD_IOCTL) {
>  		fd = iio_event_getfd(indio_dev);
> +		if (fd < 0)
> +			return fd;
>  		if (copy_to_user(ip, &fd, sizeof(fd)))
>  			return -EFAULT;
>  		return 0;
> 


      reply	other threads:[~2015-09-20 10:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-15  7:49 [RESEND PATCH 2/4] iio: percolate error if event fd fails Linus Walleij
2015-09-20 10:53 ` Jonathan Cameron [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55FE9029.9000302@kernel.org \
    --to=jic23@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-iio@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.