Skip to content

Commit

Permalink
tty: serial: ma35d1_serial: Add missing check for ioremap
Browse files Browse the repository at this point in the history
Add check for ioremap() and return the error if it fails in order to
guarantee the success of ioremap().

Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
Acked-by: Jacky Huang <ychuang3@nuvoton.com>
Link: https://lore.kernel.org/r/20230915071106.3347-1-nichen@iscas.ac.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Chen Ni authored and Greg Kroah-Hartman committed Sep 18, 2023
1 parent ce9ecca commit 4556c36
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/tty/serial/ma35d1_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 4556c36

Please sign in to comment.