From: Dan Carpenter Date: Wed, 13 Apr 2016 06:44:31 +0000 (+0300) Subject: tty: hvc_console: silence unintialized variable warning X-Git-Tag: v4.7-rc1~94^2~31 X-Git-Url: http://git.cascardo.eti.br/?a=commitdiff_plain;h=fab794aeb60f5069a026fad8a4ff7c1cdf5b8713;p=cascardo%2Flinux.git 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/tty/hvc/hvc_console.c b/drivers/tty/hvc/hvc_console.c index 209dad8c96a0..ce864875330e 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;