Skip to content

Commit

Permalink
Fix calculation of page_len in sff_8436_read_write function (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
yurypm authored and yxieca committed Aug 21, 2018
1 parent 2991f0d commit c87ebef
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
15 changes: 15 additions & 0 deletions patch/driver-support-sff-8436-read-write-fix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Fix calculation of page_len in sff_8436_read_write function

diff --git a/drivers/misc/eeprom/sff_8436_eeprom.c b/drivers/misc/eeprom/sff_8436_eeprom.c
index 4688597..10074f0 100644
--- a/drivers/misc/eeprom/sff_8436_eeprom.c
+++ b/drivers/misc/eeprom/sff_8436_eeprom.c
@@ -689,7 +689,7 @@ static ssize_t sff_8436_read_write(struct sff_8436_data *sff_8436,
if (off + pending_len < page_start_offset + SFF_8436_PAGE_SIZE) {
page_len = pending_len;
} else {
- page_len = SFF_8436_PAGE_SIZE - off;
+ page_len = SFF_8436_PAGE_SIZE - (off - page_start_offset);
}
} else {
page_offset = page_start_offset;
1 change: 1 addition & 0 deletions patch/series
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ driver-support-sff-8436-eeprom.patch
driver-support-sff-8436-eeprom-update.patch
driver-sff-8436-use-nvmem-framework.patch
driver-sff-8436-use-nvmem_device_read.patch
driver-support-sff-8436-read-write-fix.patch
driver-i2c-bus-intel-ismt-add-delay-param.patch
driver-pca954x-i2c-mux-force-deselect-on-exit-flag.patch
kernel-add-kexec-reboot-string.patch
Expand Down

0 comments on commit c87ebef

Please sign in to comment.