projects
/
GitHub
/
LineageOS
/
android_kernel_samsung_universal7580.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
84ec06c
)
virtio: console: Un-block reads on chardev close
author
Amit Shah
<amit.shah@redhat.com>
Thu, 2 Sep 2010 12:41:43 +0000
(18:11 +0530)
committer
Rusty Russell
<rusty@rustcorp.com.au>
Thu, 21 Oct 2010 07:14:01 +0000
(17:44 +1030)
If a chardev is closed, any blocked read / poll calls should just return
and not attempt to use other state.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
drivers/char/virtio_console.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/char/virtio_console.c
b/drivers/char/virtio_console.c
index e1d382b155322b2bda662f70bb6bd990b6a736c4..92f1f65d57a923c338d117f036af30f0af054963 100644
(file)
--- a/
drivers/char/virtio_console.c
+++ b/
drivers/char/virtio_console.c
@@
-528,6
+528,10
@@
static ssize_t fill_readbuf(struct port *port, char *out_buf, size_t out_count,
/* The condition that must be true for polling to end */
static bool will_read_block(struct port *port)
{
+ if (!port->guest_connected) {
+ /* Port got hot-unplugged. Let's exit. */
+ return false;
+ }
return !port_has_data(port) && port->host_connected;
}