From c87ebef623b60455edbdd71e33ac2c204b9e681d Mon Sep 17 00:00:00 2001 From: yurypm Date: Wed, 22 Aug 2018 00:57:40 +0100 Subject: [PATCH] Fix calculation of page_len in sff_8436_read_write function (#57) --- .../driver-support-sff-8436-read-write-fix.patch | 15 +++++++++++++++ patch/series | 1 + 2 files changed, 16 insertions(+) create mode 100644 patch/driver-support-sff-8436-read-write-fix.patch diff --git a/patch/driver-support-sff-8436-read-write-fix.patch b/patch/driver-support-sff-8436-read-write-fix.patch new file mode 100644 index 000000000000..e51e3fec996a --- /dev/null +++ b/patch/driver-support-sff-8436-read-write-fix.patch @@ -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; diff --git a/patch/series b/patch/series index 9b5362482120..b0b9f95f21d4 100644 --- a/patch/series +++ b/patch/series @@ -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