]> 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 00:15:24 +0000 (11:15 +1100)
commit622f65e5610c51d7d442ed88fe9fa5b4c0dcde41
tree4dc8f557f46a36ec8fdda6532bfa6db5c576850d
parent8ec02f12e1e9b5d7fd18ef55f1b4f1ec917fb940
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