diff options
author | Andrzej Hajda <a.hajda@samsung.com> | 2015-09-21 15:33:38 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-10-04 19:09:21 +0100 |
commit | 14996122a47bb489233629533bc059af50628ec8 (patch) | |
tree | 09a5b62374d3645fcbb60ee0a0e68fa1f7ff5379 /drivers/tty/serial/lpc32xx_hs.c | |
parent | 618bbaa260a3aa469e13a8f7c3e2a65e456c7005 (diff) |
tty: serial: lpc32xx_hs: fix handling platform_get_irq result
The function can return negative values.
The problem has been detected using proposed semantic patch
scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci [1].
[1]: http://permalink.gmane.org/gmane.linux.kernel/2038576
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/lpc32xx_hs.c')
-rw-r--r-- | drivers/tty/serial/lpc32xx_hs.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/tty/serial/lpc32xx_hs.c b/drivers/tty/serial/lpc32xx_hs.c index e92d7ebe9e77..7eb04ae71cc8 100644 --- a/drivers/tty/serial/lpc32xx_hs.c +++ b/drivers/tty/serial/lpc32xx_hs.c @@ -691,12 +691,13 @@ static int serial_hs_lpc32xx_probe(struct platform_device *pdev) p->port.mapbase = res->start; p->port.membase = NULL; - p->port.irq = platform_get_irq(pdev, 0); - if (p->port.irq < 0) { + ret = platform_get_irq(pdev, 0); + if (ret < 0) { dev_err(&pdev->dev, "Error getting irq for HS UART port %d\n", uarts_registered); - return p->port.irq; + return ret; } + p->port.irq = ret; p->port.iotype = UPIO_MEM32; p->port.uartclk = LPC32XX_MAIN_OSC_FREQ; |