From: "Randy.Dunlap" <rddunlap@osdl.org>

On Fri, 3 Oct 2003 15:46:40 -0700 John Cherry <cherry@osdl.org> wrote:

| drivers/char/applicom.c:260:2: warning: #warning "LEAK"
| drivers/char/applicom.c:524:2: warning: #warning "Je suis stupide. DW. - copy*user in cli"
| drivers/char/applicom.c:67: warning: `applicom_pci_tbl' defined but not used

Here's a patch for applicom.c.  David Woodhouse has reviewed and okayed it,
although he no longer has hardware to test it.



 25-akpm/drivers/char/applicom.c |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)

diff -puN drivers/char/applicom.c~applicom-fixes drivers/char/applicom.c
--- 25/drivers/char/applicom.c~applicom-fixes	Mon Oct 13 14:35:07 2003
+++ 25-akpm/drivers/char/applicom.c	Mon Oct 13 14:35:07 2003
@@ -214,6 +214,7 @@ int __init applicom_init(void)
 
 		if (!RamIO) {
 			printk(KERN_INFO "ac.o: Failed to ioremap PCI memory space at 0x%lx\n", dev->resource[0].start);
+			pci_disable_device(dev);
 			return -EIO;
 		}
 
@@ -225,12 +226,14 @@ int __init applicom_init(void)
 						  (unsigned long)RamIO,0))) {
 			printk(KERN_INFO "ac.o: PCI Applicom device doesn't have correct signature.\n");
 			iounmap(RamIO);
+			pci_disable_device(dev);
 			continue;
 		}
 
 		if (request_irq(dev->irq, &ac_interrupt, SA_SHIRQ, "Applicom PCI", &dummy)) {
 			printk(KERN_INFO "Could not allocate IRQ %d for PCI Applicom device.\n", dev->irq);
 			iounmap(RamIO);
+			pci_disable_device(dev);
 			apbs[boardno - 1].RamIO = 0;
 			continue;
 		}
@@ -257,12 +260,6 @@ int __init applicom_init(void)
 
 	/* Now try the specified ISA cards */
 
-#warning "LEAK"
-	RamIO = ioremap(mem, LEN_RAM_IO * MAX_ISA_BOARD);
-
-	if (!RamIO) 
-		printk(KERN_INFO "ac.o: Failed to ioremap ISA memory space at 0x%lx\n", mem);
-
 	for (i = 0; i < MAX_ISA_BOARD; i++) {
 		RamIO = ioremap(mem + (LEN_RAM_IO * i), LEN_RAM_IO);
 
@@ -285,7 +282,8 @@ int __init applicom_init(void)
 				iounmap((void *) RamIO);
 				apbs[boardno - 1].RamIO = 0;
 			}
-			apbs[boardno - 1].irq = irq;
+			else
+				apbs[boardno - 1].irq = irq;
 		}
 		else
 			apbs[boardno - 1].irq = 0;

_