diff options
author | Zhang Shurong <zhang_shurong@foxmail.com> | 2023-08-26 17:32:24 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-09-18 11:14:43 +0200 |
commit | 4e8da86fc1f767371f4395d0d94870ed1e08aa1e (patch) | |
tree | ab974082d52a6de2f3e24603ae0bc1e7c42fb917 | |
parent | 66ebe67d1b68bebc4b49d022a28f8c6492044f32 (diff) | |
download | linux-stable-4e8da86fc1f767371f4395d0d94870ed1e08aa1e.tar.gz linux-stable-4e8da86fc1f767371f4395d0d94870ed1e08aa1e.tar.bz2 linux-stable-4e8da86fc1f767371f4395d0d94870ed1e08aa1e.zip |
tty: serial: linflexuart: Fix to check return value of platform_get_irq() in linflex_probe()
The platform_get_irq might be failed and return a negative result. So
there should have an error handling code.
Fixed this by adding an error handling code.
Signed-off-by: Zhang Shurong <zhang_shurong@foxmail.com>
Link: https://lore.kernel.org/r/tencent_234B0AACD06350E10D7548C2E086A9166305@qq.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/tty/serial/fsl_linflexuart.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/tty/serial/fsl_linflexuart.c b/drivers/tty/serial/fsl_linflexuart.c index 249cb380c3c6..02e93b2f7183 100644 --- a/drivers/tty/serial/fsl_linflexuart.c +++ b/drivers/tty/serial/fsl_linflexuart.c @@ -832,10 +832,14 @@ static int linflex_probe(struct platform_device *pdev) return PTR_ERR(sport->membase); sport->mapbase = res->start; + ret = platform_get_irq(pdev, 0); + if (ret < 0) + return ret; + sport->dev = &pdev->dev; sport->type = PORT_LINFLEXUART; sport->iotype = UPIO_MEM; - sport->irq = platform_get_irq(pdev, 0); + sport->irq = ret; sport->ops = &linflex_pops; sport->flags = UPF_BOOT_AUTOCONF; sport->has_sysrq = IS_ENABLED(CONFIG_SERIAL_FSL_LINFLEXUART_CONSOLE); |