]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
virtio_console: initialize vtermno value for ports
authorPankaj Gupta <pagupta@redhat.com>
Tue, 19 Mar 2019 06:04:06 +0000 (11:34 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 31 May 2019 13:43:47 +0000 (06:43 -0700)
commitddbc7bfaa7cffc43045127966c3828d78a8859df
tree3b4b0559ebc5b22271d08dc4bc709fc553c79213
parentaaf5aa44934ad069cac805923c49f6968b9a0d49
virtio_console: initialize vtermno value for ports

[ Upstream commit 4b0a2c5ff7215206ea6135a405f17c5f6fca7d00 ]

For regular serial ports we do not initialize value of vtermno
variable. A garbage value is assigned for non console ports.
The value can be observed as a random integer with [1].

[1] vim /sys/kernel/debug/virtio-ports/vport*p*

This patch initialize the value of vtermno for console serial
ports to '1' and regular serial ports are initiaized to '0'.

Reported-by: siliu@redhat.com
Signed-off-by: Pankaj Gupta <pagupta@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/char/virtio_console.c