From fd4d3bb6fe612c7e4285e1693a86ac6d0b65418b Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Sun, 17 Jul 2016 13:02:44 -0300 Subject: [PATCH] [media] cec: poll should check if there is room in the tx queue For POLLOUT poll only checked if the adapter was configured, not if there was room in the transmit queue. Add that check. Change-Id: I56fc0585999f4c5ac313305fe43c54a2a1592879 Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Git-commit: b7cbc892532316f2abd880186301e57239a17f28 Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git Signed-off-by: Ray Zhang --- drivers/staging/media/cec/cec-api.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/media/cec/cec-api.c b/drivers/staging/media/cec/cec-api.c index 559f6500d114..7be7615a0fdf 100644 --- a/drivers/staging/media/cec/cec-api.c +++ b/drivers/staging/media/cec/cec-api.c @@ -52,7 +52,8 @@ static unsigned int cec_poll(struct file *filp, if (!devnode->registered) return POLLERR | POLLHUP; mutex_lock(&adap->lock); - if (adap->is_configured) + if (adap->is_configured && + adap->transmit_queue_sz < CEC_MAX_MSG_TX_QUEUE_SZ) res |= POLLOUT | POLLWRNORM; if (fh->queued_msgs) res |= POLLIN | POLLRDNORM;