summaryrefslogtreecommitdiffstats
path: root/drivers/nvmem
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-05-09 09:34:49 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-05-09 09:34:49 +0200
commit725d0123dfff3d7b666cf57f5d29c50addfc99d3 (patch)
tree12ec63b2c3965033f30185b4b2f5f12039a9a242 /drivers/nvmem
parent8cd1f9d01cbf4f46eace90d9792e65a209c37d31 (diff)
parent44549e8f5eea4e0a41b487b63e616cb089922b99 (diff)
downloadlinux-725d0123dfff3d7b666cf57f5d29c50addfc99d3.tar.bz2
Merge 4.6-rc7 into char-misc-testing
This resolves a merge issue with drivers/hv/ring_buffer.c Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/nvmem')
-rw-r--r--drivers/nvmem/mxs-ocotp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/nvmem/mxs-ocotp.c b/drivers/nvmem/mxs-ocotp.c
index 8ba19bba3156..2bb3c5799ac4 100644
--- a/drivers/nvmem/mxs-ocotp.c
+++ b/drivers/nvmem/mxs-ocotp.c
@@ -94,7 +94,7 @@ static int mxs_ocotp_read(void *context, const void *reg, size_t reg_size,
if (ret)
goto close_banks;
- while (val_size) {
+ while (val_size >= reg_size) {
if ((offset < OCOTP_DATA_OFFSET) || (offset % 16)) {
/* fill up non-data register */
*buf = 0;
@@ -103,7 +103,7 @@ static int mxs_ocotp_read(void *context, const void *reg, size_t reg_size,
}
buf++;
- val_size--;
+ val_size -= reg_size;
offset += reg_size;
}