diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2016-05-11 00:00:29 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2016-05-11 00:00:29 -0400 |
commit | e4d35be584be88a3db3fa5635a97c62a2ec5aafe (patch) | |
tree | fc22a7fb65697306edd71411959ccee6df60c64d /drivers/nvmem/mxs-ocotp.c | |
parent | 99d825822eade8d827a1817357cbf3f889a552d6 (diff) | |
parent | 38b78a5f18584db6fa7441e0f4531b283b0e6725 (diff) | |
download | talos-obmc-linux-e4d35be584be88a3db3fa5635a97c62a2ec5aafe.tar.gz talos-obmc-linux-e4d35be584be88a3db3fa5635a97c62a2ec5aafe.zip |
Merge branch 'ovl-fixes' into for-linus
Diffstat (limited to 'drivers/nvmem/mxs-ocotp.c')
-rw-r--r-- | drivers/nvmem/mxs-ocotp.c | 4 |
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; } |