summaryrefslogtreecommitdiffstats
path: root/drivers/nvmem
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2016-05-09 05:49:56 +0200
committerDave Airlie <airlied@redhat.com>2016-05-09 05:49:56 +0200
commitbafb86f5bc3173479002555dea7f31d943b12332 (patch)
tree6ec94c96460faf782cdb8781339560e13e0918b0 /drivers/nvmem
parentdrm/amdgpu: fix build on aarch64. (diff)
parentLinux 4.6-rc7 (diff)
downloadlinux-bafb86f5bc3173479002555dea7f31d943b12332.tar.xz
linux-bafb86f5bc3173479002555dea7f31d943b12332.zip
Merge tag 'v4.6-rc7' into drm-next
Merge this back as we've built up a fair few conflicts, and I have some newer trees to pull in.
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;
}