]> 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>
Tue, 1 Nov 2011 23:04:25 +0000 (10:04 +1100)
commit772d90457e3f72d58c2bf4dcec5046ab9ed5a2e3
treeebfbeec65eba055f9dbe5dc461335d47015b89c9
parenta91fa2c8f2fbf655a722b0656901d66df32e7b21
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