[PATCH 2/3] cec: remove WARN_ON

Hans Verkuil hverkuil at xs4all.nl
Wed May 11 07:11:27 UTC 2016


From: Hans Verkuil <hans.verkuil at cisco.com>

If a transmit is issued and before cec_transmit_done() is called the HDMI cable
is unplugged, then it is possible that adap->transmitting == NULL.

So drop the WARN_ON, explain why it can happen and just ignore the tranmit.

Signed-off-by: Hans Verkuil <hans.verkuil at cisco.com>
---
 drivers/staging/media/cec/cec.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/media/cec/cec.c b/drivers/staging/media/cec/cec.c
index 3c5f084..9a62aa2 100644
--- a/drivers/staging/media/cec/cec.c
+++ b/drivers/staging/media/cec/cec.c
@@ -485,9 +485,13 @@ void cec_transmit_done(struct cec_adapter *adap, u8 status, u8 arb_lost_cnt,
 	dprintk(2, "cec_transmit_done %02x\n", status);
 	mutex_lock(&adap->lock);
 	data = adap->transmitting;
-	if (WARN_ON(data == NULL)) {
-		/* This is weird and should not happen. Ignore this transmit */
-		dprintk(0, "cec_transmit_done without an ongoing transmit!\n");
+	if (data == NULL) {
+		/*
+		 * This can happen if a transmit was issued and the cable is
+		 * unplugged while the transmit is ongoing. Ignore this
+		 * transmit in that case.
+		 */
+		dprintk(1, "cec_transmit_done without an ongoing transmit!\n");
 		goto unlock;
 	}
 
-- 
2.8.1



More information about the dri-devel mailing list