[PATCH] powerpc/xmon: Fix whitespace handling in getstring()

Michael Ellerman patch-notifications at ellerman.id.au
Wed Feb 19 23:40:05 AEDT 2020


On Mon, 2020-02-17 at 04:13:43 UTC, Oliver O'Halloran wrote:
> The ls (lookup symbol) and zr (reboot) commands use xmon's getstring()
> helper to read a string argument from the xmon prompt. This function skips
> over leading whitespace, but doesn't check if the first "non-whitespace"
> character is a newline which causes some odd behaviour (<enter> indicates
> a the enter key was pressed):
> 
> 	0:mon> ls printk<enter>
> 	printk: c0000000001680c4
> 
> 	0:mon> ls<enter>
> 	printk<enter>
> 	Symbol '
> 	printk' not found.
> 	0:mon>
> 
> With commit 2d9b332d99b ("powerpc/xmon: Allow passing an argument
> to ppc_md.restart()") we have a similar problem with the zr command.
> Previously zr took no arguments so "zr<enter> would trigger a reboot.
> With that patch applied a second newline needs to be sent in order for
> the reboot to occur. Fix this by checking if the leading whitespace
> ended on a newline:
> 
> 	0:mon> ls<enter>
> 	Symbol '' not found.
> 
> Fixes: 2d9b332d99b ("powerpc/xmon: Allow passing an argument to ppc_md.restart()")
> Reported-by: Michael Ellerman <mpe at ellerman.id.au>
> Signed-off-by: Oliver O'Halloran <oohall at gmail.com>

Applied to powerpc fixes, thanks.

https://git.kernel.org/powerpc/c/066bc3576e653b615ee3f5230a89d69c8ebeeb71

cheers


More information about the Linuxppc-dev mailing list