diff options
-rw-r--r-- | kernel/trace/trace.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 36cbb873845f..d345d649d073 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -335,7 +335,8 @@ trace_seq_putmem(struct trace_seq *s, void *mem, size_t len) | |||
335 | return len; | 335 | return len; |
336 | } | 336 | } |
337 | 337 | ||
338 | #define HEX_CHARS 17 | 338 | #define MAX_MEMHEX_BYTES 8 |
339 | #define HEX_CHARS (MAX_MEMHEX_BYTES*2 + 1) | ||
339 | 340 | ||
340 | static int | 341 | static int |
341 | trace_seq_putmem_hex(struct trace_seq *s, void *mem, size_t len) | 342 | trace_seq_putmem_hex(struct trace_seq *s, void *mem, size_t len) |
@@ -344,8 +345,6 @@ trace_seq_putmem_hex(struct trace_seq *s, void *mem, size_t len) | |||
344 | unsigned char *data = mem; | 345 | unsigned char *data = mem; |
345 | int i, j; | 346 | int i, j; |
346 | 347 | ||
347 | BUG_ON(len >= HEX_CHARS); | ||
348 | |||
349 | #ifdef __BIG_ENDIAN | 348 | #ifdef __BIG_ENDIAN |
350 | for (i = 0, j = 0; i < len; i++) { | 349 | for (i = 0, j = 0; i < len; i++) { |
351 | #else | 350 | #else |
@@ -1668,6 +1667,7 @@ do { \ | |||
1668 | 1667 | ||
1669 | #define SEQ_PUT_HEX_FIELD_RET(s, x) \ | 1668 | #define SEQ_PUT_HEX_FIELD_RET(s, x) \ |
1670 | do { \ | 1669 | do { \ |
1670 | BUILD_BUG_ON(sizeof(x) > MAX_MEMHEX_BYTES); \ | ||
1671 | if (!trace_seq_putmem_hex(s, &(x), sizeof(x))) \ | 1671 | if (!trace_seq_putmem_hex(s, &(x), sizeof(x))) \ |
1672 | return 0; \ | 1672 | return 0; \ |
1673 | } while (0) | 1673 | } while (0) |