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: 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: 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>

authored by

Chen Ni and committed by
Greg Kroah-Hartman
4556c36f ce9ecca0

+3
+3
drivers/tty/serial/ma35d1_serial.c
··· 695 695 696 696 up->port.iobase = res_mem->start; 697 697 up->port.membase = ioremap(up->port.iobase, MA35_UART_REG_SIZE); 698 + if (!up->port.membase) 699 + return -ENOMEM; 700 + 698 701 up->port.ops = &ma35d1serial_ops; 699 702 700 703 spin_lock_init(&up->port.lock);