mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
i2c: slave-eeprom: fix boundary check when using sysfs
Due to a copy&paste error, the last byte of the shared memory was not accessible via sysfs. Reported-by: Debora Grosse <[email protected]> Signed-off-by: Wolfram Sang <[email protected]> Acked-by: Laurent Pinchart <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
This commit is contained in:
parent
8edba330c8
commit
2541f7f4c1
1 changed files with 2 additions and 2 deletions
|
|
@ -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));
|
||||
|
|
|
|||
Loading…
Reference in a new issue