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.2.51~79 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0426ea8291c0cdcf0d585c39a7bfae18e621d93b;p=pandora-kernel.git virtio: console: fix race with port unplug and open/close commit 057b82be3ca3d066478e43b162fc082930a746c9 upstream. 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. Reported-by: Mateusz Guzik Signed-off-by: Amit Shah Signed-off-by: Rusty Russell Signed-off-by: Ben Hutchings --- Reading git-diff-tree failed