summaryrefslogtreecommitdiffstats
path: root/drivers/media/rc/sir_ir.c
diff options
context:
space:
mode:
authorSean Young2017-05-16 09:56:14 +0200
committerMauro Carvalho Chehab2017-05-18 11:16:41 +0200
commit592ddc9f7db36c778d3bf9ffdfd93d8d5d548e48 (patch)
tree54d0f00a521bc3daebba00a24d9aad8a8ec2d123 /drivers/media/rc/sir_ir.c
parent[media] atomisp: don't treat warnings as errors (diff)
downloadkernel-qcow2-linux-592ddc9f7db36c778d3bf9ffdfd93d8d5d548e48.tar.gz
kernel-qcow2-linux-592ddc9f7db36c778d3bf9ffdfd93d8d5d548e48.tar.xz
kernel-qcow2-linux-592ddc9f7db36c778d3bf9ffdfd93d8d5d548e48.zip
[media] sir_ir: infinite loop in interrupt handler
Since this driver does no detection of hardware, it might be used with a non-sir port. Escape out if we are spinning. Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/rc/sir_ir.c')
-rw-r--r--drivers/media/rc/sir_ir.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/media/rc/sir_ir.c b/drivers/media/rc/sir_ir.c
index e12ec50bf0bf..90a5f8fd5eea 100644
--- a/drivers/media/rc/sir_ir.c
+++ b/drivers/media/rc/sir_ir.c
@@ -183,9 +183,15 @@ static irqreturn_t sir_interrupt(int irq, void *dev_id)
static unsigned long delt;
unsigned long deltintr;
unsigned long flags;
+ int counter = 0;
int iir, lsr;
while ((iir = inb(io + UART_IIR) & UART_IIR_ID)) {
+ if (++counter > 256) {
+ dev_err(&sir_ir_dev->dev, "Trapped in interrupt");
+ break;
+ }
+
switch (iir & UART_IIR_ID) { /* FIXME toto treba preriedit */
case UART_IIR_MSI:
(void)inb(io + UART_MSR);