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

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.cn


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ce9ecca0
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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);