]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - queue-4.4/virtio_console-initialize-vtermno-value-for-ports.patch
drop rdma-cma-consider-scope_id-while-binding-to-ipv6-ll-.patch from 4.4, 4.9, and...
[thirdparty/kernel/stable-queue.git] / queue-4.4 / virtio_console-initialize-vtermno-value-for-ports.patch
CommitLineData
1143c684
SL
1From 7aaa89e6e9a11ccebe11c5be97913644c1bbd124 Mon Sep 17 00:00:00 2001
2From: Pankaj Gupta <pagupta@redhat.com>
3Date: Tue, 19 Mar 2019 11:34:06 +0530
4Subject: virtio_console: initialize vtermno value for ports
5
6[ Upstream commit 4b0a2c5ff7215206ea6135a405f17c5f6fca7d00 ]
7
8For regular serial ports we do not initialize value of vtermno
9variable. A garbage value is assigned for non console ports.
10The value can be observed as a random integer with [1].
11
12[1] vim /sys/kernel/debug/virtio-ports/vport*p*
13
14This patch initialize the value of vtermno for console serial
15ports to '1' and regular serial ports are initiaized to '0'.
16
17Reported-by: siliu@redhat.com
18Signed-off-by: Pankaj Gupta <pagupta@redhat.com>
19Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
20Signed-off-by: Sasha Levin <sashal@kernel.org>
21---
22 drivers/char/virtio_console.c | 3 ++-
23 1 file changed, 2 insertions(+), 1 deletion(-)
24
25diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c
26index 2aca689061e1f..df9eab91c2d25 100644
27--- a/drivers/char/virtio_console.c
28+++ b/drivers/char/virtio_console.c
29@@ -76,7 +76,7 @@ struct ports_driver_data {
30 /* All the console devices handled by this driver */
31 struct list_head consoles;
32 };
33-static struct ports_driver_data pdrvdata;
34+static struct ports_driver_data pdrvdata = { .next_vtermno = 1};
35
36 static DEFINE_SPINLOCK(pdrvdata_lock);
37 static DECLARE_COMPLETION(early_console_added);
38@@ -1419,6 +1419,7 @@ static int add_port(struct ports_device *portdev, u32 id)
39 port->async_queue = NULL;
40
41 port->cons.ws.ws_row = port->cons.ws.ws_col = 0;
42+ port->cons.vtermno = 0;
43
44 port->host_connected = port->guest_connected = false;
45 port->stats = (struct port_stats) { 0 };
46--
472.20.1
48