From: Hans Verkuil Date: Sun, 17 Jul 2016 16:02:44 +0000 (-0300) Subject: [media] cec: poll should check if there is room in the tx queue X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b7cbc892532316f2abd880186301e57239a17f28;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git [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 Signed-off-by: Mauro Carvalho Chehab --- 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;