Commit fab794ae authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman

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: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 42331433
...@@ -814,7 +814,7 @@ static int hvc_poll_get_char(struct tty_driver *driver, int line) ...@@ -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); n = hp->ops->get_chars(hp->vtermno, &ch, 1);
if (n == 0) if (n <= 0)
return NO_POLL_CHAR; return NO_POLL_CHAR;
return ch; return ch;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment