]> git.karo-electronics.de Git - karo-tx-linux.git/commit
virtio: console: Ignore port name update request if name already set
authorAmit Shah <amit.shah@redhat.com>
Wed, 14 Sep 2011 07:36:40 +0000 (13:06 +0530)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 15 Sep 2011 00:38:13 +0000 (10:38 +1000)
commitf239caf7eefc44cd8c625e2bc01b362bc242129d
tree89523e225661eeced247250c9918ef4679b78c0a
parent9fc2f7cf209948949a94d500af963dbcc8ba613f
virtio: console: Ignore port name update request if name already set

We don't allow port name changes dynamically for a port.  So any
requests by the host to change the name are ignored.

Before this patch, if the hypervisor sent a port name while we had one
set already, we would leak memory equivalent to the size of the old
name.

This scenario wasn't expected so far, but with the suspend-resume
support, we'll send the VIRTIO_CONSOLE_PORT_READY message after restore,
which can get us into this situation.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
drivers/char/virtio_console.c