OSDN Git Service

media: cec: forgot to cancel delayed work
authorHans Verkuil <hverkuil@xs4all.nl>
Mon, 15 Oct 2018 10:14:22 +0000 (06:14 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 13 Nov 2018 19:08:53 +0000 (11:08 -0800)
commit2781b86d7e45de09befa5ace296b66787146561f
tree30bb397d12bf10af10a75cfe6e73bf378a6a1268
parentb68d405a2e6a3e8236773b12739ef684fb43d0e9
media: cec: forgot to cancel delayed work

commit 490d84f6d73c12f4204241cff8651eed60aae914 upstream.

If the wait for completion was interrupted, then make sure to cancel
any delayed work.

This can only happen if a transmit is waiting for a reply, and you press
Ctrl-C or reboot/poweroff or something like that which interrupts the
thread waiting for the reply and then proceeds to delete the CEC message.

Since the delayed work wasn't canceled, once it would trigger it referred
to stale data and resulted in a kernel oops.

Fixes: 7ec2b3b941a6 ("cec: add new tx/rx status bits to detect aborts/timeouts")

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: <stable@vger.kernel.org> # for v4.18 and up
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/cec/cec-adap.c