public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Walls <awalls@md.metrocast.net>
To: Jarod Wilson <jarod@redhat.com>
Cc: linux-media@vger.kernel.org
Subject: Re: [PATCH 5/6] lirc_zilog: error out if buffer read bytes != chunk size
Date: Wed, 16 Mar 2011 20:07:22 -0400	[thread overview]
Message-ID: <1300320442.2296.25.camel@localhost> (raw)
In-Reply-To: <1300307071-19665-6-git-send-email-jarod@redhat.com>

On Wed, 2011-03-16 at 16:24 -0400, Jarod Wilson wrote:
> Signed-off-by: Jarod Wilson <jarod@redhat.com>
> ---
>  drivers/staging/lirc/lirc_zilog.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/staging/lirc/lirc_zilog.c b/drivers/staging/lirc/lirc_zilog.c
> index 407d4b4..5ada643 100644
> --- a/drivers/staging/lirc/lirc_zilog.c
> +++ b/drivers/staging/lirc/lirc_zilog.c
> @@ -950,6 +950,10 @@ static ssize_t read(struct file *filep, char *outbuf, size_t n, loff_t *ppos)
>  				ret = copy_to_user((void *)outbuf+written, buf,
>  						   rbuf->chunk_size);
>  				written += rbuf->chunk_size;
> +			} else {
> +				zilog_error("Buffer read failed!\n");
> +				ret = -EIO;
> +				break;

No need to break, just let the non-0 ret value drop you out of the while
loop.

Regards,
Andy

>  			}
>  		}
>  	}



  reply	other threads:[~2011-03-17  0:07 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-16 20:24 [PATCH 0/6] media: trivial IR fixes Jarod Wilson
2011-03-16 20:24 ` [PATCH 1/6] docs: fix typo in lirc_device_interface.xml Jarod Wilson
2011-03-16 20:24 ` [PATCH 2/6] imon: add more panel scancode mappings Jarod Wilson
2011-03-16 20:24 ` [PATCH 3/6] ir-kbd-i2c: pass device code w/key in hauppauge case Jarod Wilson
2011-03-16 20:24 ` [PATCH 4/6] lirc: silence some compile warnings Jarod Wilson
2011-03-16 20:24 ` [PATCH 5/6] lirc_zilog: error out if buffer read bytes != chunk size Jarod Wilson
2011-03-17  0:07   ` Andy Walls [this message]
2011-03-17 13:19     ` Jarod Wilson
2011-03-17 15:29       ` Andy Walls
2011-03-17 15:42         ` Jarod Wilson
2011-03-17 16:16           ` Andy Walls
2011-03-17 19:08             ` Jarod Wilson
2011-03-18  0:50               ` Andy Walls
2011-03-22 20:39                 ` Jarod Wilson
2011-03-16 20:24 ` [PATCH 6/6] mceusb: topseed 0x0011 needs gen3 init for tx to work Jarod Wilson

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=1300320442.2296.25.camel@localhost \
    --to=awalls@md.metrocast.net \
    --cc=jarod@redhat.com \
    --cc=linux-media@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox