Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 561e1030 authored by Christian Borntraeger's avatar Christian Borntraeger Committed by Martin Schwidefsky
Browse files

s390/dis: Fix printing of the register numbers



Since commit b006f19b ("lib/vsprintf.c: handle invalid format
specifiers more robustly") I get errors like
[...]
Krnl Code: 00000000004e2410: c00400000000        brcl 0,4e2410
Please remove unsupported %r in format string
[    8.179483] ------------[ cut here ]------------
[    8.179484] WARNING: at lib/vsprintf.c:1781

Turns out that our disassembler relied on %r not being used as format
string. Let's do the proper escaping of our decode buffers.

Signed-off-by: default avatarChristian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 155eeb66
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -2015,7 +2015,7 @@ void show_code(struct pt_regs *regs)
			*ptr++ = '\t';
			*ptr++ = '\t';
		ptr += print_insn(ptr, code + start, addr);
		ptr += print_insn(ptr, code + start, addr);
		start += opsize;
		start += opsize;
		printk(buffer);
		printk("%s", buffer);
		ptr = buffer;
		ptr = buffer;
		ptr += sprintf(ptr, "\n          ");
		ptr += sprintf(ptr, "\n          ");
		hops++;
		hops++;
@@ -2042,7 +2042,7 @@ void print_fn_code(unsigned char *code, unsigned long len)
		ptr += print_insn(ptr, code, (unsigned long) code);
		ptr += print_insn(ptr, code, (unsigned long) code);
		*ptr++ = '\n';
		*ptr++ = '\n';
		*ptr++ = 0;
		*ptr++ = 0;
		printk(buffer);
		printk("%s", buffer);
		code += opsize;
		code += opsize;
		len -= opsize;
		len -= opsize;
	}
	}