summaryrefslogtreecommitdiff
path: root/lib/seq_buf.c
diff options
context:
space:
mode:
authorMichael Bestas <mkbestas@lineageos.org>2021-07-22 01:39:54 +0300
committerMichael Bestas <mkbestas@lineageos.org>2021-07-22 01:39:54 +0300
commit954d3318ebc1b79dc469995450b23c30ce44b6af (patch)
tree50ba2449476562b2aa8e2f6bd55e5f4915958163 /lib/seq_buf.c
parent3c741a8b469c522434e6841d8618702303fd6a21 (diff)
parente5239ed489f6471bc235af8534ee57d1923778e4 (diff)
Merge branch 'android-4.4-p' of https://android.googlesource.com/kernel/common into lineage-18.1-caf-msm8998
This brings LA.UM.9.2.r1-03400-SDMxx0.0 up to date with https://android.googlesource.com/kernel/common/ android-4.4-p at commit: e5239ed489f64 Merge 4.4.276 into android-4.4-p Change-Id: I5f3fdc31e61b229b299cf72014710d36e42863d8
Diffstat (limited to 'lib/seq_buf.c')
-rw-r--r--lib/seq_buf.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/seq_buf.c b/lib/seq_buf.c
index cbef5ee4c459..a139298ad6ca 100644
--- a/lib/seq_buf.c
+++ b/lib/seq_buf.c
@@ -227,8 +227,10 @@ int seq_buf_putmem_hex(struct seq_buf *s, const void *mem,
WARN_ON(s->size == 0);
+ BUILD_BUG_ON(MAX_MEMHEX_BYTES * 2 >= HEX_CHARS);
+
while (len) {
- start_len = min(len, HEX_CHARS - 1);
+ start_len = min(len, MAX_MEMHEX_BYTES);
#ifdef __BIG_ENDIAN
for (i = 0, j = 0; i < start_len; i++) {
#else
@@ -241,12 +243,14 @@ int seq_buf_putmem_hex(struct seq_buf *s, const void *mem,
break;
/* j increments twice per loop */
- len -= j / 2;
hex[j++] = ' ';
seq_buf_putmem(s, hex, j);
if (seq_buf_has_overflowed(s))
return -1;
+
+ len -= start_len;
+ data += start_len;
}
return 0;
}