auxdisplay: charlcd: fix x/y command parsing
authorMans Rullgard <mans@mansr.com>
Wed, 5 Dec 2018 13:52:47 +0000 (13:52 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 13 Jan 2019 08:51:03 +0000 (09:51 +0100)
commit218c81851f11712653487ee36a7a564ea3b7a254
tree414c213115b898072a5c5757564e35ebfba3a193
parentdc68052427be094c97be535710a29764bf633430
auxdisplay: charlcd: fix x/y command parsing

[ Upstream commit 9bc30ab82108e6a34dc63bf956b49edf71b1681a ]

The x/y command parsing has been broken since commit 129957069e6a
("staging: panel: Fixed checkpatch warning about simple_strtoul()").

Commit b34050fadb86 ("auxdisplay: charlcd: Fix and clean up handling of
x/y commands") fixed some problems by rewriting the parsing code,
but also broke things further by removing the check for a complete
command before attempting to parse it.  As a result, parsing is
terminated at the first x or y character.

This reinstates the check for a final semicolon.  Whereas the original
code use strchr(), this is wasteful seeing as the semicolon is always
at the end of the buffer.  Thus check this character directly instead.

Signed-off-by: Mans Rullgard <mans@mansr.com>
Signed-off-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/auxdisplay/charlcd.c