All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 4 of 5 ] /drivers/char/rio ioremap balancing/ returncode check
@ 2007-08-13  4:05 ` Scott Thompson
  0 siblings, 0 replies; 16+ messages in thread
From: Scott Thompson @ 2007-08-13  4:05 UTC (permalink / raw)
  To: linux-kernel, kernel-janitors, dri-devel

patchset against 2.6.23-rc2 and this set is an audit of 
/drivers/char/a* 
through drivers/char .   

this corrects missing ioremap return checks and balancing on 
iounmap calls..

Signed-off-by: Scott Thompson <postfail <at> hushmail.com>
----------------------------------------------------------
diff --git a/drivers/char/rio/rio_linux.c 
b/drivers/char/rio/rio_linux.c
index 0ce9667..fdaf44f 100644
--- a/drivers/char/rio/rio_linux.c
+++ b/drivers/char/rio/rio_linux.c
@@ -924,6 +924,11 @@ static void fix_rio_pci(struct pci_dev *pdev)
 
 	hwbase = pci_resource_start(pdev, 0);
 	rebase = ioremap(hwbase, 0x80);
+	if (!rebase) {
+		printk(KERN_DEBUG "rio: unable to perform cntrl reg fix as 
ioremap call failed\n");
+		return;
+	}
+		
 	t = readl(rebase + CNTRL_REG_OFFSET);
 	if (t != CNTRL_REG_GOODVALUE) {
 		printk(KERN_DEBUG "rio: performing cntrl reg fix: %08x -> 
%08x\n", t, CNTRL_REG_GOODVALUE);
@@ -996,6 +1001,11 @@ static int __init rio_init(void)
 		if (((1 << hp->Ivec) & rio_irqmask) = 0)
 			hp->Ivec = 0;
 		hp->Caddr = ioremap(p->RIOHosts[p->RIONumHosts].PaddrP, 
RIO_WINDOW_LEN);
+		if (!hp->Caddr) {
+			printk(KERN_ERR "RIO: Unable to ioremap.\n");
+			return -ENOMEM;
+		}
+
 		hp->CardP = (struct DpRam __iomem *) hp->Caddr;
 		hp->Type = RIO_PCI;
 		hp->Copy = rio_copy_to_card;
@@ -1049,6 +1059,10 @@ static int __init rio_init(void)
 			hp->Ivec = 0;
 		hp->Ivec |= 0x8000;	/* Mark as non-sharable */
 		hp->Caddr = ioremap(p->RIOHosts[p->RIONumHosts].PaddrP, 
RIO_WINDOW_LEN);
+		if (!hp->Caddr) {
+			printk(KERN_ERR "RIO: Unable to ioremap.\n");
+			return -ENOMEM;
+		}
 		hp->CardP = (struct DpRam __iomem *) hp->Caddr;
 		hp->Type = RIO_PCI;
 		hp->Copy = rio_copy_to_card;



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

end of thread, other threads:[~2007-08-15 19:53 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-13  4:05 [PATCH 4 of 5 ] /drivers/char/rio ioremap balancing/ returncode check Scott Thompson
2007-08-13  4:05 ` Scott Thompson
2007-08-13 10:42 ` [PATCH 4 of 5 ] /drivers/char/rio ioremap balancing/ returncode Alan Cox
2007-08-13 10:42   ` [PATCH 4 of 5 ] /drivers/char/rio ioremap balancing/ returncode check Alan Cox
2007-08-13 12:50 ` Scott Thompson
2007-08-13 12:50   ` Scott Thompson
2007-08-13 13:21   ` [PATCH 4 of 5 ] /drivers/char/rio ioremap balancing/ returncode Alan Cox
2007-08-13 13:21     ` [PATCH 4 of 5 ] /drivers/char/rio ioremap balancing/ returncode check Alan Cox
2007-08-13 20:30 ` [PATCH 4 of 5 ] /drivers/char/rio ioremap balancing/ returncode Jiri Slaby
2007-08-13 20:30   ` [PATCH 4 of 5 ] /drivers/char/rio ioremap balancing/ returncode check Jiri Slaby
2007-08-14  4:01 ` Scott Thompson
2007-08-14  4:01   ` Scott Thompson
2007-08-15 19:38   ` [PATCH 4 of 5 ] /drivers/char/rio ioremap balancing/ returncode Jiri Slaby
2007-08-15 19:38     ` [PATCH 4 of 5 ] /drivers/char/rio ioremap balancing/ returncode check Jiri Slaby
2007-08-15 19:52 ` Scott Thompson
2007-08-15 19:52   ` Scott Thompson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.