git.openpandora.org
/
pandora-kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
virtio: console: fix race in port_fops_open() and port unplug
[pandora-kernel.git]
/
drivers
/
char
/
virtio_console.c
diff --git
a/drivers/char/virtio_console.c
b/drivers/char/virtio_console.c
index
5746a36
..
6379ffa
100644
(file)
--- a/
drivers/char/virtio_console.c
+++ b/
drivers/char/virtio_console.c
@@
-798,6
+798,10
@@
static int port_fops_open(struct inode *inode, struct file *filp)
/* We get the port with a kref here */
port = find_port_by_devt(cdev->dev);
+ if (!port) {
+ /* Port was unplugged before we could proceed */
+ return -ENXIO;
+ }
filp->private_data = port;
/*