Skip to content

Commit 9fe2816

Browse files
Hans Verkuilmchehab
authored andcommitted
media: cec: cec-adap: always cancel work in cec_transmit_msg_fh
Do not check for !data->completed, just always call cancel_delayed_work_sync(). This fixes a small race condition. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Reported-by: Yang, Chenyuan <cy54@illinois.edu> Closes: https://lore.kernel.org/linux-media/PH7PR11MB57688E64ADE4FE82E658D86DA09EA@PH7PR11MB5768.namprd11.prod.outlook.com/ Fixes: 490d84f ("media: cec: forgot to cancel delayed work") Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
1 parent 5c883a7 commit 9fe2816

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

drivers/media/cec/core/cec-adap.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -936,8 +936,7 @@ int cec_transmit_msg_fh(struct cec_adapter *adap, struct cec_msg *msg,
936936
*/
937937
mutex_unlock(&adap->lock);
938938
wait_for_completion_killable(&data->c);
939-
if (!data->completed)
940-
cancel_delayed_work_sync(&data->work);
939+
cancel_delayed_work_sync(&data->work);
941940
mutex_lock(&adap->lock);
942941

943942
/* Cancel the transmit if it was interrupted */

0 commit comments

Comments
 (0)