From: Amit Shah Date: Mon, 29 Jul 2013 04:46:13 +0000 (+0930) Subject: virtio: console: fix race with port unplug and open/close X-Git-Tag: v3.11-rc5~25^2~5 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=057b82be3ca3d066478e43b162fc082930a746c9;p=pandora-kernel.git 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: Reported-by: Mateusz Guzik Signed-off-by: Amit Shah Signed-off-by: Rusty Russell --- Reading git-diff-tree failed