mirror of
https://github.com/FEX-Emu/linux.git
synced 2025-01-18 23:59:53 +00:00
tty: serial: 8250: 8250_gsc:- Handle return NULL error from ioremap_nocache
Here, If ioremap_nocache will fail. It will return NULL. Kernel can run into a NULL-pointer dereference. This error check will avoid NULL pointer dereference. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
28ec9570a2
commit
2cc32b18d1
@ -60,6 +60,10 @@ static int __init serial_init_chip(struct parisc_device *dev)
|
|||||||
7272727 : 1843200;
|
7272727 : 1843200;
|
||||||
uart.port.mapbase = address;
|
uart.port.mapbase = address;
|
||||||
uart.port.membase = ioremap_nocache(address, 16);
|
uart.port.membase = ioremap_nocache(address, 16);
|
||||||
|
if (!uart.port.membase) {
|
||||||
|
dev_warn(&dev->dev, "Failed to map memory\n");
|
||||||
|
return -ENOMEM;
|
||||||
|
}
|
||||||
uart.port.irq = dev->irq;
|
uart.port.irq = dev->irq;
|
||||||
uart.port.flags = UPF_BOOT_AUTOCONF;
|
uart.port.flags = UPF_BOOT_AUTOCONF;
|
||||||
uart.port.dev = &dev->dev;
|
uart.port.dev = &dev->dev;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user