aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/virtio_console.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/virtio_console.c')
-rw-r--r--drivers/char/virtio_console.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c
index f404ccfc9c20..026ea6c27e07 100644
--- a/drivers/char/virtio_console.c
+++ b/drivers/char/virtio_console.c
@@ -25,6 +25,7 @@
25#include <linux/list.h> 25#include <linux/list.h>
26#include <linux/poll.h> 26#include <linux/poll.h>
27#include <linux/sched.h> 27#include <linux/sched.h>
28#include <linux/slab.h>
28#include <linux/spinlock.h> 29#include <linux/spinlock.h>
29#include <linux/virtio.h> 30#include <linux/virtio.h>
30#include <linux/virtio_console.h> 31#include <linux/virtio_console.h>
@@ -681,6 +682,10 @@ static void resize_console(struct port *port)
681 struct virtio_device *vdev; 682 struct virtio_device *vdev;
682 struct winsize ws; 683 struct winsize ws;
683 684
685 /* The port could have been hot-unplugged */
686 if (!port)
687 return;
688
684 vdev = port->portdev->vdev; 689 vdev = port->portdev->vdev;
685 if (virtio_has_feature(vdev, VIRTIO_CONSOLE_F_SIZE)) { 690 if (virtio_has_feature(vdev, VIRTIO_CONSOLE_F_SIZE)) {
686 vdev->config->get(vdev, 691 vdev->config->get(vdev,
@@ -947,11 +952,18 @@ static void handle_control_message(struct ports_device *portdev,
947 */ 952 */
948 err = sysfs_create_group(&port->dev->kobj, 953 err = sysfs_create_group(&port->dev->kobj,
949 &port_attribute_group); 954 &port_attribute_group);
950 if (err) 955 if (err) {
951 dev_err(port->dev, 956 dev_err(port->dev,
952 "Error %d creating sysfs device attributes\n", 957 "Error %d creating sysfs device attributes\n",
953 err); 958 err);
954 959 } else {
960 /*
961 * Generate a udev event so that appropriate
962 * symlinks can be created based on udev
963 * rules.
964 */
965 kobject_uevent(&port->dev->kobj, KOBJ_CHANGE);
966 }
955 break; 967 break;
956 case VIRTIO_CONSOLE_PORT_REMOVE: 968 case VIRTIO_CONSOLE_PORT_REMOVE:
957 /* 969 /*