Re: [PATCH] vivid: ignore failed messages in vivid_received()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 27/04/2023 22:49, Hans Verkuil wrote:
> 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.
> 
> Signed-off-by: Hans Verkuil <hverkuil-cisco@xxxxxxxxx>
> ---
> diff --git a/drivers/media/test-drivers/vivid/vivid-cec.c b/drivers/media/test-drivers/vivid/vivid-cec.c
> index 1f7469ff04d5..8399298d54ad 100644
> --- a/drivers/media/test-drivers/vivid/vivid-cec.c
> +++ b/drivers/media/test-drivers/vivid/vivid-cec.c
> @@ -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



[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux