]> git.baikalelectronics.ru Git - kernel.git/commit
staging: speakup: fix misuse of kstrtol() in handle_goto()
authorDaeseok Youn <daeseok.youn@gmail.com>
Wed, 9 Apr 2014 10:45:46 +0000 (19:45 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Apr 2014 18:41:44 +0000 (11:41 -0700)
commit574fffedb8e33c68936057614cfb6fd14396579b
tree8beea2bf45b41e7b91fd544da43d89330ccb96d5
parent28fb68eeab21bbd4942139000e71d353ed9c6e53
staging: speakup: fix misuse of kstrtol() in handle_goto()

A string of goto_buf has a number followed by x or y.
e.g. "3x" means move 3 lines down.
The kstrtol() returns an error(-EINVAL) with this string so
go_pos has unsigned a value of that error.
And also "*cp" has not expected value.

And fix sparse warnings:
 drivers/staging/speakup/main.c:1901 handle_goto() warn: unsigned '(speakup_console[vc->vc_num]->go_pos)' is never less than zero.
 drivers/staging/speakup/main.c:1911 handle_goto() warn: unsigned '(speakup_console[vc->vc_num]->go_pos)' is never less than zero.

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/speakup/main.c