diff options
author | Sean Young <sean@mess.org> | 2017-05-16 03:56:14 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-06-06 06:19:10 -0400 |
commit | f8c627fbabbe9ed6ae68dcfefb7519bd153a7ac0 (patch) | |
tree | 70d497fb0fea384db72f806c7db85a6ecb1d1469 | |
parent | ae8eb443a17331a07579bc04817accaaaa62b78e (diff) |
[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>
-rw-r--r-- | drivers/media/rc/sir_ir.c | 6 |
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) | |||
183 | static unsigned long delt; | 183 | static unsigned long delt; |
184 | unsigned long deltintr; | 184 | unsigned long deltintr; |
185 | unsigned long flags; | 185 | unsigned long flags; |
186 | int counter = 0; | ||
186 | int iir, lsr; | 187 | int iir, lsr; |
187 | 188 | ||
188 | while ((iir = inb(io + UART_IIR) & UART_IIR_ID)) { | 189 | while ((iir = inb(io + UART_IIR) & UART_IIR_ID)) { |
190 | if (++counter > 256) { | ||
191 | dev_err(&sir_ir_dev->dev, "Trapped in interrupt"); | ||
192 | break; | ||
193 | } | ||
194 | |||
189 | switch (iir & UART_IIR_ID) { /* FIXME toto treba preriedit */ | 195 | switch (iir & UART_IIR_ID) { /* FIXME toto treba preriedit */ |
190 | case UART_IIR_MSI: | 196 | case UART_IIR_MSI: |
191 | (void)inb(io + UART_MSR); | 197 | (void)inb(io + UART_MSR); |