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

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Zhang Shurong and committed by
Greg Kroah-Hartman
4e8da86f 66ebe67d

+5 -1
+5 -1
drivers/tty/serial/fsl_linflexuart.c
··· 832 832 return PTR_ERR(sport->membase); 833 833 sport->mapbase = res->start; 834 834 835 + ret = platform_get_irq(pdev, 0); 836 + if (ret < 0) 837 + return ret; 838 + 835 839 sport->dev = &pdev->dev; 836 840 sport->type = PORT_LINFLEXUART; 837 841 sport->iotype = UPIO_MEM; 838 - sport->irq = platform_get_irq(pdev, 0); 842 + sport->irq = ret; 839 843 sport->ops = &linflex_pops; 840 844 sport->flags = UPF_BOOT_AUTOCONF; 841 845 sport->has_sysrq = IS_ENABLED(CONFIG_SERIAL_FSL_LINFLEXUART_CONSOLE);