vivid: ignore failed messages in vivid_received()
Subsystems (2)
PATCH 1/1 vivid: ignore failed messages in vivid_received()
If a non-blocking transmit failed (either the transmit itself failed, or the reply (if requested) never arrived, then the received callback is still called since in some cases a driver might need to know about that.
The vivid_received function didn't check this and instead could try to transmit a reply, which can lead to a deadlock.
---
drivers/media/test-drivers/vivid/vivid-cec.c +3 -0
@@ -269,6 +269,9 @@ static int vivid_received(struct cec_adapter *adap, struct cec_msg *msg)u8 disp_ctl;char osd[14 ]; +if (!cec_msg_status_is_ok (msg)) +return 0 ; +if (cec_msg_is_broadcast (msg)) dest = adap->log_addrs.log_addr[0 ];cec_msg_init (&reply, dest,cec_msg_initiator (msg));
Quoted 15 lines · Hans Verkuil
If a non-blocking transmit failed (either the transmit itself failed, or the reply (if requested) never arrived, then the received callback is still called since in some cases a driver might need to know about that.
The
vivid_receivedfunction didn't check this and instead could try to transmit a reply, which can lead to a deadlock.Signed-off-by Hans Verkuil <[email protected]>---
drivers/media/test-drivers/vivid/vivid-cec.c +0
-0
drivers/media/test-drivers/vivid/vivid-cec.c static int vivid_received(struct cec_adapter *adap, struct cec_msg *msg) · line 277
Quoted 9 lines
drivers/media/test-drivers/vivid/vivid-cec.c +3
-0@@ -269,6 +269,9 @@ static int vivid_received(struct cec_adapter *adap, struct cec_msg *msg)u8 disp_ctl;char osd[14 ]; +if (!cec_msg_status_is_ok (msg)) +return 0 ; +if (cec_msg_is_broadcast (msg)) dest = adap->log_addrs.log_addr[0 ];cec_msg_init (&reply, dest,cec_msg_initiator (msg));
Disregard this, this is not the right approach.
Regards,
Hans