From: Amit Shah Date: Fri, 4 Mar 2011 03:34:33 +0000 (+1030) Subject: virtio: console: Don't access vqs if device was unplugged X-Git-Tag: v2.6.38-rc8~8 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d7a62cd0332115d4c7c4689abea0d889a30d8349;p=pandora-kernel.git virtio: console: Don't access vqs if device was unplugged If a virtio-console device gets unplugged while a port is open, a subsequent close() call on the port accesses vqs to free up buffers. This can lead to a crash. The buffers are already freed up as a result of the call to unplug_ports() from virtcons_remove(). The fix is to simply not access vq information if port->portdev is NULL. Reported-by: juzhang CC: stable@kernel.org Signed-off-by: Amit Shah Signed-off-by: Rusty Russell Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed