* [PATCH] i2c: slave-eeprom: fix boundary check when using sysfs
@ 2015-01-19 16:22 ` Wolfram Sang
0 siblings, 0 replies; 6+ messages in thread
From: Wolfram Sang @ 2015-01-19 16:22 UTC (permalink / raw)
To: linux-sh
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>
---
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));
--
2.1.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] i2c: slave-eeprom: fix boundary check when using sysfs
@ 2015-01-19 16:22 ` Wolfram Sang
0 siblings, 0 replies; 6+ messages in thread
From: Wolfram Sang @ 2015-01-19 16:22 UTC (permalink / raw)
To: linux-i2c
Cc: linux-sh, Wolfram Sang, Magnus Damm, Simon Horman,
Laurent Pinchart, Geert Uytterhoeven, Debora Grosse
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>
---
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));
--
2.1.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] i2c: slave-eeprom: fix boundary check when using sysfs
2015-01-19 16:22 ` Wolfram Sang
@ 2015-01-20 13:52 ` Laurent Pinchart
-1 siblings, 0 replies; 6+ messages in thread
From: Laurent Pinchart @ 2015-01-20 13:52 UTC (permalink / raw)
To: linux-sh
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] i2c: slave-eeprom: fix boundary check when using sysfs
@ 2015-01-20 13:52 ` Laurent Pinchart
0 siblings, 0 replies; 6+ messages in thread
From: Laurent Pinchart @ 2015-01-20 13:52 UTC (permalink / raw)
To: Wolfram Sang
Cc: linux-i2c, linux-sh, Magnus Damm, Simon Horman,
Geert Uytterhoeven, Debora Grosse
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] i2c: slave-eeprom: fix boundary check when using sysfs
2015-01-19 16:22 ` Wolfram Sang
@ 2015-01-22 14:23 ` Wolfram Sang
-1 siblings, 0 replies; 6+ messages in thread
From: Wolfram Sang @ 2015-01-22 14:23 UTC (permalink / raw)
To: linux-sh
[-- Attachment #1: Type: text/plain, Size: 376 bytes --]
On Mon, Jan 19, 2015 at 05:22:55PM +0100, 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>
Applied to for-current, thanks!
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] i2c: slave-eeprom: fix boundary check when using sysfs
@ 2015-01-22 14:23 ` Wolfram Sang
0 siblings, 0 replies; 6+ messages in thread
From: Wolfram Sang @ 2015-01-22 14:23 UTC (permalink / raw)
To: linux-i2c
Cc: linux-sh, Magnus Damm, Simon Horman, Laurent Pinchart,
Geert Uytterhoeven, Debora Grosse
[-- Attachment #1: Type: text/plain, Size: 376 bytes --]
On Mon, Jan 19, 2015 at 05:22:55PM +0100, 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>
Applied to for-current, thanks!
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-01-22 14:23 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-19 16:22 [PATCH] i2c: slave-eeprom: fix boundary check when using sysfs Wolfram Sang
2015-01-19 16:22 ` Wolfram Sang
2015-01-20 13:52 ` Laurent Pinchart
2015-01-20 13:52 ` Laurent Pinchart
2015-01-22 14:23 ` Wolfram Sang
2015-01-22 14:23 ` Wolfram Sang
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.