aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/base/regmap/regmap-debugfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/base/regmap/regmap-debugfs.c b/drivers/base/regmap/regmap-debugfs.c
index f42f2bac6466..1f327898e53d 100644
--- a/drivers/base/regmap/regmap-debugfs.c
+++ b/drivers/base/regmap/regmap-debugfs.c
@@ -432,7 +432,7 @@ static ssize_t regmap_access_read_file(struct file *file,
432 /* If we're in the region the user is trying to read */ 432 /* If we're in the region the user is trying to read */
433 if (p >= *ppos) { 433 if (p >= *ppos) {
434 /* ...but not beyond it */ 434 /* ...but not beyond it */
435 if (buf_pos >= count - 1 - tot_len) 435 if (buf_pos + tot_len + 1 >= count)
436 break; 436 break;
437 437
438 /* Format the register */ 438 /* Format the register */