diff options
| -rw-r--r-- | drivers/char/virtio_console.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index 3beea9d478bc..ffa7e46faff9 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c | |||
| @@ -1041,6 +1041,10 @@ static int port_fops_open(struct inode *inode, struct file *filp) | |||
| 1041 | 1041 | ||
| 1042 | /* We get the port with a kref here */ | 1042 | /* We get the port with a kref here */ |
| 1043 | port = find_port_by_devt(cdev->dev); | 1043 | port = find_port_by_devt(cdev->dev); |
| 1044 | if (!port) { | ||
| 1045 | /* Port was unplugged before we could proceed */ | ||
| 1046 | return -ENXIO; | ||
| 1047 | } | ||
| 1044 | filp->private_data = port; | 1048 | filp->private_data = port; |
| 1045 | 1049 | ||
| 1046 | /* | 1050 | /* |
