浏览代码

[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.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Hans Verkuil 9 年之前
父节点
当前提交
b7cbc89253
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      drivers/staging/media/cec/cec-api.c

+ 2 - 1
drivers/staging/media/cec/cec-api.c

@@ -52,7 +52,8 @@ static unsigned int cec_poll(struct file *filp,
 	if (!devnode->registered)
 	if (!devnode->registered)
 		return POLLERR | POLLHUP;
 		return POLLERR | POLLHUP;
 	mutex_lock(&adap->lock);
 	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;
 		res |= POLLOUT | POLLWRNORM;
 	if (fh->queued_msgs)
 	if (fh->queued_msgs)
 		res |= POLLIN | POLLRDNORM;
 		res |= POLLIN | POLLRDNORM;