[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 <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Git-commit: b7cbc892532316f2abd880186301e57239a17f28
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
This commit is contained in:
Hans Verkuil 2016-07-17 13:02:44 -03:00 committed by Ray Zhang
parent 69333ef727
commit fd4d3bb6fe

View file

@ -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;