media: cec-pin.c: don't zero work_pin_num_events in adap_enable
authorHans Verkuil <hverkuil-cisco@xs4all.nl>
Tue, 10 May 2022 11:59:48 +0000 (13:59 +0200)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Fri, 13 May 2022 09:27:47 +0000 (11:27 +0200)
commit5f4eb16750511125aa1a874dd8cf1682a9d6a8a7
treee71e3acf0c948f6a9105b69d5df6c7b5eae96d6b
parent60965c6a1960988bcb5ad3b530ccd133af5cc85d
media: cec-pin.c: don't zero work_pin_num_events in adap_enable

It's OK to keep the pending pin events when disabling or
enabling the 'adapter'. Zeroing this can cause a race condition
if this happens when the pin kthread is handling a pin event
and calls atomic_dec later, causing work_pin_num_events to become
negative.

Just leave pending events in the queue, they'll be read eventually.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/cec/core/cec-pin.c