lkml.org 
[lkml]   [2001]   [Feb]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] drivers/char/serial.c unchecked ioremap() calls

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.ascdiff -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 */[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2005-03-22 13:17    [W:0.028 / U:2.216 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site