]> git.baikalelectronics.ru Git - kernel.git/commit
[media] rc: Call rc_register_device before irq setup
authorMatthijs Kooijman <matthijs@stdin.nl>
Fri, 2 Nov 2012 12:13:56 +0000 (09:13 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Fri, 21 Dec 2012 20:26:11 +0000 (18:26 -0200)
commitce4c362c8fec73c8b706d73c470f51b86b01aaa9
tree5496a8441112847b57a97324c39e907d77cff5c4
parent37135b85c68b6eba49d596f8bbcc8995a215589c
[media] rc: Call rc_register_device before irq setup

This should fix a potential race condition, when the irq handler
triggers while rc_register_device is still setting up the rdev->raw
device.
This crash has not been observed in practice, but there should be a very
small window where it could occur. Since ir_raw_event_store_with_filter
checks if rdev->raw is not NULL before using it, this bug is not
triggered if the request_irq triggers a pending irq directly (since
rdev->raw will still be NULL then).
This commit was tested on nuvoton-cir only.

Cc: Jarod Wilson <jarod@redhat.com>
Cc: Maxim Levitsky <maximlevitsky@gmail.com>
Cc: David Härdeman <david@hardeman.nu>
Signed-off-by: Matthijs Kooijman <matthijs@stdin.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/rc/ene_ir.c
drivers/media/rc/ite-cir.c
drivers/media/rc/nuvoton-cir.c
drivers/media/rc/winbond-cir.c