aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-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,
94 if (ret) 94 if (ret)
95 goto close_banks; 95 goto close_banks;
96 96
97 while (val_size) { 97 while (val_size >= reg_size) {
98 if ((offset < OCOTP_DATA_OFFSET) || (offset % 16)) { 98 if ((offset < OCOTP_DATA_OFFSET) || (offset % 16)) {
99 /* fill up non-data register */ 99 /* fill up non-data register */
100 *buf = 0; 100 *buf = 0;
@@ -103,7 +103,7 @@ static int mxs_ocotp_read(void *context, const void *reg, size_t reg_size,
103 } 103 }
104 104
105 buf++; 105 buf++;
106 val_size--; 106 val_size -= reg_size;
107 offset += reg_size; 107 offset += reg_size;
108 } 108 }
109 109