public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drivers/char/serial.c unchecked ioremap() calls
@ 2001-02-23  7:53 Andrey Panin
  2001-02-23  9:45 ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 4+ messages in thread
From: Andrey Panin @ 2001-02-23  7:53 UTC (permalink / raw)
  To: linux-kernel


[-- Attachment #1.1: Type: text/plain, Size: 273 bytes --]


Hi all,

16x50 serial driver doesn't check ioremap() return value. 
Atached patch should fix this it.

Best regards.

-- 
Andrey Panin            | Embedded systems software engineer
pazke@orbita1.ru        | PGP key: http://www.orbita1.ru/~pazke/AndreyPanin.asc

[-- Attachment #1.2: patch-ioremap-serial --]
[-- Type: text/plain, Size: 1103 bytes --]

diff -ur linux.vanilla/drivers/char/serial.c linux/drivers/char/serial.c
--- linux.vanilla/drivers/char/serial.c	Thu Feb 22 20:50:18 2001
+++ linux/drivers/char/serial.c	Thu Feb 22 23:01:48 2001
@@ -3876,7 +3876,8 @@
 		return 0;
 	}
 	req->io_type = SERIAL_IO_MEM;
-	req->iomem_base = ioremap(port, board->uart_offset);
+	if ((req->iomem_base = ioremap(port, board->uart_offset)) == NULL)
+		return 1;
 	req->iomem_reg_shift = board->reg_shift;
 	req->port = 0;
 	return 0;
@@ -4010,7 +4011,8 @@
 				      data | pci_config);
 	
 	/* enable/disable interrupts */
-	p = ioremap(pci_resource_start(dev, 0), 0x80);
+	if ((p = ioremap(pci_resource_start(dev, 0), 0x80)) == NULL)
+		return 1;
 	writel(enable ? irq_config : 0x00, (unsigned long)p + 0x4c);
 	iounmap(p);
 
@@ -4053,7 +4055,8 @@
 
        if (!enable) return 0;
 
-       p = ioremap(pci_resource_start(dev, 0), 0x80);
+       if ((p = ioremap(pci_resource_start(dev, 0), 0x80)) == NULL)
+		return 1;
 
        switch (dev->device & 0xfff8) {
                case PCI_DEVICE_ID_SIIG_1S_10x:         /* 1S */

[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2001-02-26 15:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-02-23  7:53 [PATCH] drivers/char/serial.c unchecked ioremap() calls Andrey Panin
2001-02-23  9:45 ` Arnaldo Carvalho de Melo
2001-02-23 14:15   ` Jeff Garzik
2001-02-26 15:06     ` Andrey Panin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox