Skip to content

Commit

Permalink
[media] cec: fix test for unconfigured adapter in main message loop
Browse files Browse the repository at this point in the history
The main message loop checks if the physical address was valid, and if
not it is assumed that the adapter had been unconfigured.

However, this check is no longer correct, instead it should check
that both adap->is_configured and adap->is_configuring are false.

Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
Hans Verkuil authored and mchehab committed Jul 19, 2016
1 parent 11065f8 commit 58ecc29
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/staging/media/cec/cec-adap.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ int cec_thread_func(void *_adap)
*/
err = wait_event_interruptible_timeout(adap->kthread_waitq,
kthread_should_stop() ||
adap->phys_addr == CEC_PHYS_ADDR_INVALID ||
(!adap->is_configured && !adap->is_configuring) ||
(!adap->transmitting &&
!list_empty(&adap->transmit_queue)),
msecs_to_jiffies(CEC_XFER_TIMEOUT_MS));
Expand All @@ -347,7 +347,7 @@ int cec_thread_func(void *_adap)

mutex_lock(&adap->lock);

if (adap->phys_addr == CEC_PHYS_ADDR_INVALID ||
if ((!adap->is_configured && !adap->is_configuring) ||
kthread_should_stop()) {
/*
* If the adapter is disabled, or we're asked to stop,
Expand Down

0 comments on commit 58ecc29

Please sign in to comment.