]> 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>
Wed, 5 Oct 2011 01:01:21 +0000 (12:01 +1100)
commit2dc96793a836f1e30d5944124e1c2189b8247f7f
tree3a48c5ce02aa548a0067b2c5d905f981a6e706b0
parentf6e0f24c3252f2f38afb0d5a1a77e144b4e64f93
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