diff options
| author | Ingo Molnar <mingo@elte.hu> | 2010-09-22 12:45:01 -0400 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2010-09-22 12:45:01 -0400 |
| commit | 90edf27fb89241917e91155bfdcc7c8e5a587222 (patch) | |
| tree | a2d1841cfe382f426a3b6ccb306b0665ad455885 /drivers/char/virtio_console.c | |
| parent | 41945f6ccf1e86f87fddf6b32db9cf431c05fb54 (diff) | |
| parent | 8b15575cae7a93a784c3005c42b069edd9ba64dd (diff) | |
Merge branch 'linus' into perf/core
Conflicts:
kernel/hw_breakpoint.c
Merge reason: resolve the conflict.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'drivers/char/virtio_console.c')
| -rw-r--r-- | drivers/char/virtio_console.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index 942a9826bd23..c810481a5bc2 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c | |||
| @@ -596,6 +596,10 @@ static ssize_t port_fops_write(struct file *filp, const char __user *ubuf, | |||
| 596 | ssize_t ret; | 596 | ssize_t ret; |
| 597 | bool nonblock; | 597 | bool nonblock; |
| 598 | 598 | ||
| 599 | /* Userspace could be out to fool us */ | ||
| 600 | if (!count) | ||
| 601 | return 0; | ||
| 602 | |||
| 599 | port = filp->private_data; | 603 | port = filp->private_data; |
| 600 | 604 | ||
| 601 | nonblock = filp->f_flags & O_NONBLOCK; | 605 | nonblock = filp->f_flags & O_NONBLOCK; |
| @@ -642,7 +646,7 @@ static unsigned int port_fops_poll(struct file *filp, poll_table *wait) | |||
| 642 | poll_wait(filp, &port->waitqueue, wait); | 646 | poll_wait(filp, &port->waitqueue, wait); |
| 643 | 647 | ||
| 644 | ret = 0; | 648 | ret = 0; |
| 645 | if (port->inbuf) | 649 | if (!will_read_block(port)) |
| 646 | ret |= POLLIN | POLLRDNORM; | 650 | ret |= POLLIN | POLLRDNORM; |
| 647 | if (!will_write_block(port)) | 651 | if (!will_write_block(port)) |
| 648 | ret |= POLLOUT; | 652 | ret |= POLLOUT; |
