tty: hvc_console: silence unintialized variable warning
If ->get_char() returns a negative error code and that can mean that "ch" is uninitialized. The callers of this function expect NO_POLL_CHAR on error so let's return that. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
423314337a
commit
fab794aeb6
1 changed files with 1 additions and 1 deletions
|
@ -814,7 +814,7 @@ static int hvc_poll_get_char(struct tty_driver *driver, int line)
|
|||
|
||||
n = hp->ops->get_chars(hp->vtermno, &ch, 1);
|
||||
|
||||
if (n == 0)
|
||||
if (n <= 0)
|
||||
return NO_POLL_CHAR;
|
||||
|
||||
return ch;
|
||||
|
|
Loading…
Reference in a new issue