commit | 057b82be3ca3d066478e43b162fc082930a746c9 | [log] [tgz] |
---|---|---|
author | Amit Shah <amit.shah@redhat.com> | Mon Jul 29 14:16:13 2013 +0930 |
committer | Rusty Russell <rusty@rustcorp.com.au> | Mon Jul 29 14:43:28 2013 +0930 |
tree | 8ca217f1b7c0e48a21540cb38779cc7a48216535 | |
parent | 2b4fbf029dff5a28d9bf646346dea891ec43398a [diff] |
virtio: console: fix race with port unplug and open/close There's a window between find_port_by_devt() returning a port and us taking a kref on the port, where the port could get unplugged. Fix it by taking the reference in find_port_by_devt() itself. Problem reported and analyzed by Mateusz Guzik. CC: <stable@vger.kernel.org> Reported-by: Mateusz Guzik <mguzik@redhat.com> Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>