Skip to content

Commit

Permalink
[media] sir_ir: infinite loop in interrupt handler
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sean Young authored and Mauro Carvalho Chehab committed Jun 6, 2017
1 parent ae8eb44 commit f8c627f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/media/rc/sir_ir.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f8c627f

Please sign in to comment.