Commit 4556c36f authored by Chen Ni's avatar Chen Ni Committed by Greg Kroah-Hartman

tty: serial: ma35d1_serial: Add missing check for ioremap

Add check for ioremap() and return the error if it fails in order to
guarantee the success of ioremap().
Signed-off-by: default avatarChen Ni <nichen@iscas.ac.cn>
Acked-by: default avatarJacky Huang <ychuang3@nuvoton.com>
Link: https://lore.kernel.org/r/20230915071106.3347-1-nichen@iscas.ac.cnSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ce9ecca0
......@@ -695,6 +695,9 @@ static int ma35d1serial_probe(struct platform_device *pdev)
up->port.iobase = res_mem->start;
up->port.membase = ioremap(up->port.iobase, MA35_UART_REG_SIZE);
if (!up->port.membase)
return -ENOMEM;
up->port.ops = &ma35d1serial_ops;
spin_lock_init(&up->port.lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment