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:48:29 +0000 (06:48 -0700)
commit6673b01c7f498b2a0770f58b020968c98a3cb49e
treec451871779f65d52f4d3f97a0b5d49f2af230ffa
parent7b98acf18eb8429aaf8cf7513b7a078736ea9c1b
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