diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2016-04-13 06:44:31 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-04-30 16:26:55 (GMT) |
commit | fab794aeb60f5069a026fad8a4ff7c1cdf5b8713 (patch) | |
tree | a26c118ca3c5c69522f94608498eda47094746dd /drivers/tty/hvc/hvc_console.c | |
parent | 423314337acde8ddda6324f0917b306642b3ef6c (diff) | |
download | linux-fab794aeb60f5069a026fad8a4ff7c1cdf5b8713.tar.xz |
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>
Diffstat (limited to 'drivers/tty/hvc/hvc_console.c')
-rw-r--r-- | drivers/tty/hvc/hvc_console.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/tty/hvc/hvc_console.c b/drivers/tty/hvc/hvc_console.c index 209dad8..ce86487 100644 --- a/drivers/tty/hvc/hvc_console.c +++ b/drivers/tty/hvc/hvc_console.c @@ -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; |