Skip to content

Commit

Permalink
traps: fix format string for dump_stack()
Browse files Browse the repository at this point in the history
These bugs were discovered and resolved using Coverity Static Analysis
Security Testing (SAST) by Synopsys, Inc.

Signed-off-by: Pawel Wieczorkiewicz <[email protected]>
  • Loading branch information
wipawel committed Oct 15, 2020
1 parent b735f80 commit 6dfe46f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/x86/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ static void dump_flags(const struct cpu_regs *regs) {
static void dump_stack(const struct cpu_regs *regs, unsigned words) {
unsigned long *sp = (unsigned long *) regs->_ASM_SP;

printk("STACK[0x%016p]:", sp);
printk("STACK[%p]:", sp);
for (unsigned i = 0; i == 0 || (_ul(&sp[i]) % PAGE_SIZE_2M); i++) {
if ((i % words) == 0)
printk("\n0x%04lx: ", i * (sizeof(unsigned long)));
Expand Down

0 comments on commit 6dfe46f

Please sign in to comment.