virtio: console: Ignore port name update request if name already set
commit291024ef351328e7b4ca6bae798abc816a43653c
authorAmit Shah <amit.shah@redhat.com>
Wed, 14 Sep 2011 07:36:40 +0000 (14 13:06 +0530)
committerRusty Russell <rusty@rustcorp.com.au>
Wed, 2 Nov 2011 01:10:59 +0000 (2 11:40 +1030)
treeda54013a26d70be3136266692eea6ac95077f865
parent286f9a226f11e4a05d08999417fd838c0ca91d7a
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