From: Amit Shah Date: Fri, 19 Mar 2010 12:06:44 +0000 (+0530) Subject: virtio: console: Check if port is valid in resize_console X-Git-Tag: v3.0~5380^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2de16a493cc6153f7fa0b9da12a3862d063e3425;p=platform%2Fkernel%2Flinux-amlogic.git virtio: console: Check if port is valid in resize_console The console port could have been hot-unplugged. Check if it is valid before working on it. Signed-off-by: Amit Shah Signed-off-by: Michael S. Tsirkin --- diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index 67b474b..44288ce 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c @@ -681,6 +681,10 @@ static void resize_console(struct port *port) struct virtio_device *vdev; struct winsize ws; + /* The port could have been hot-unplugged */ + if (!port) + return; + vdev = port->portdev->vdev; if (virtio_has_feature(vdev, VIRTIO_CONSOLE_F_SIZE)) { vdev->config->get(vdev,