The kthread_config relies on the main kthread (message processing loop) to be present, so stop kthread_config before kthread. It's unlikely to be a problem (and I've never seen any issues), but if nothing else it makes sense to stop the threads in this order. Signed-off-by: Hans Verkuil <hverkuil-cisco@xxxxxxxxx> --- drivers/media/cec/core/cec-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/cec/core/cec-core.c b/drivers/media/cec/core/cec-core.c index 3ee16f672d68..ece236291f35 100644 --- a/drivers/media/cec/core/cec-core.c +++ b/drivers/media/cec/core/cec-core.c @@ -396,9 +396,9 @@ void cec_delete_adapter(struct cec_adapter *adap) { if (IS_ERR_OR_NULL(adap)) return; - kthread_stop(adap->kthread); if (adap->kthread_config) kthread_stop(adap->kthread_config); + kthread_stop(adap->kthread); if (adap->ops->adap_free) adap->ops->adap_free(adap); #ifdef CONFIG_MEDIA_CEC_RC -- 2.27.0