linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Wolfram Sang <wsa@the-dreams.de>
Cc: linux-i2c@vger.kernel.org, linux-sh@vger.kernel.org,
	Magnus Damm <magnus.damm@gmail.com>,
	Simon Horman <horms@verge.net.au>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Debora Grosse <debora@mds.com>
Subject: Re: [PATCH] i2c: slave-eeprom: fix boundary check when using sysfs
Date: Tue, 20 Jan 2015 15:52:15 +0200	[thread overview]
Message-ID: <2988844.NmFWX0K5r9@avalon> (raw)
In-Reply-To: <1421684575-6679-1-git-send-email-wsa@the-dreams.de>

Hi Wolfram,

Thank you for the patch.

On Monday 19 January 2015 17:22:55 Wolfram Sang wrote:
> From: Wolfram Sang <wsa+renesas@sang-engineering.com>
> 
> Due to a copy&paste error, the last byte of the shared memory was not
> accessible via sysfs.
> 
> Reported-by: Debora Grosse <debora@mds.com>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  drivers/i2c/i2c-slave-eeprom.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/i2c/i2c-slave-eeprom.c b/drivers/i2c/i2c-slave-eeprom.c
> index f432f81b0414..8f417e9054ac 100644
> --- a/drivers/i2c/i2c-slave-eeprom.c
> +++ b/drivers/i2c/i2c-slave-eeprom.c
> @@ -74,7 +74,7 @@ static ssize_t i2c_slave_eeprom_bin_read(struct file
> *filp, struct kobject *kobj struct eeprom_data *eeprom;
>  	unsigned long flags;
> 
> -	if (off + count >= attr->size)
> +	if (off + count > attr->size)
>  		return -EFBIG;
> 
>  	eeprom = dev_get_drvdata(container_of(kobj, struct device, kobj));
> @@ -92,7 +92,7 @@ static ssize_t i2c_slave_eeprom_bin_write(struct file
> *filp, struct kobject *kob struct eeprom_data *eeprom;
>  	unsigned long flags;
> 
> -	if (off + count >= attr->size)
> +	if (off + count > attr->size)
>  		return -EFBIG;
> 
>  	eeprom = dev_get_drvdata(container_of(kobj, struct device, kobj));

-- 
Regards,

Laurent Pinchart


  reply	other threads:[~2015-01-20 13:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-19 16:22 [PATCH] i2c: slave-eeprom: fix boundary check when using sysfs Wolfram Sang
2015-01-20 13:52 ` Laurent Pinchart [this message]
2015-01-22 14:23 ` Wolfram Sang

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=2988844.NmFWX0K5r9@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=debora@mds.com \
    --cc=geert@linux-m68k.org \
    --cc=horms@verge.net.au \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    --cc=wsa@the-dreams.de \
    /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;
as well as URLs for NNTP newsgroup(s).