Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

serial: bcm2835: fix unsigned int issue with irq

Fixes error condition check when requesting the irq,
that would not trigger because of uart_port.irq being
defined as unsigned int.

Reported by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Martin Sperl <kernel@martin.sperl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Martin Sperl and committed by
Greg Kroah-Hartman
e1a7d248 0ab556c2

+5 -5
+5 -5
drivers/tty/serial/8250/8250_bcm2835aux.c
··· 59 59 } 60 60 61 61 /* get the interrupt */ 62 - data->uart.port.irq = platform_get_irq(pdev, 0); 63 - if (data->uart.port.irq < 0) { 64 - dev_err(&pdev->dev, "irq not found - %i", 65 - data->uart.port.irq); 66 - return data->uart.port.irq; 62 + ret = platform_get_irq(pdev, 0); 63 + if (ret < 0) { 64 + dev_err(&pdev->dev, "irq not found - %i", ret); 65 + return ret; 67 66 } 67 + data->uart.port.irq = ret; 68 68 69 69 /* map the main registers */ 70 70 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);