All of lore.kernel.org
 help / color / mirror / Atom feed
* [KJ] [PATCH] Audit return code : drivers/char/applicom.c
@ 2005-06-21 10:13 Christophe Lucas
  2005-06-21 10:14 ` [KJ] [PATCH] Audit return code : drivers/char/lcd.c Christophe Lucas
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: Christophe Lucas @ 2005-06-21 10:13 UTC (permalink / raw)
  To: kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 140 bytes --]

description:
Audit return codes (and handle failure correctly) for misc_register.
 
Signed-off-by: Christophe Lucas <clucas@rotomalug.org>


[-- Attachment #2: patch_drivers_char_applicom.c.diff --]
[-- Type: text/plain, Size: 1591 bytes --]

diff -urpNX dontdiff 2.6.12-orig/drivers/char/applicom.c 2.6.12/drivers/char/applicom.c
--- 2.6.12-orig/drivers/char/applicom.c	2005-06-17 21:48:29.000000000 +0200
+++ 2.6.12/drivers/char/applicom.c	2005-06-21 11:25:19.448714976 +0200
@@ -172,7 +172,7 @@ static int ac_register_board(unsigned lo
 
 void cleanup_module(void)
 {
-	int i;
+	unsigned int i;
 
 	misc_deregister(&ac_miscdev);
 
@@ -195,7 +195,7 @@ int __init applicom_init(void)
 	int i, numisa = 0;
 	struct pci_dev *dev = NULL;
 	void __iomem *RamIO;
-	int boardno;
+	int boardno, ret;
 
 	printk(KERN_INFO "Applicom driver: $Id: ac.c,v 1.30 2000/03/22 16:03:57 dwmw2 Exp $\n");
 
@@ -294,7 +294,7 @@ int __init applicom_init(void)
 	}
 
 	if (!numisa)
-		printk(KERN_WARNING"ac.o: No valid ISA Applicom boards found at mem 0x%lx\n",mem);
+		printk(KERN_WARNING "ac.o: No valid ISA Applicom boards found at mem 0x%lx\n",mem);
 
  fin:
 	init_waitqueue_head(&FlagSleepRec);
@@ -304,7 +304,10 @@ int __init applicom_init(void)
 	DeviceErrorCount = 0;
 
 	if (numboards) {
-		misc_register(&ac_miscdev);
+		if (ret = misc_register(&ac_miscdev)) {
+			printk(KERN_WARNING "Unable to register misc device\n");
+			goto out;
+		}
 		for (i = 0; i < MAX_BOARD; i++) {
 			int serial;
 			char boardname[(SERIAL_NUMBER - TYPE_CARD) + 1];
@@ -337,6 +340,17 @@ int __init applicom_init(void)
 
 	else
 		return -ENXIO;
+
+out:
+	for (i = 0 ; i < MAX_BOARD ; i++) {
+		if (apbs[i].RamIO)
+			continue;
+		if (apbs[i].irq)
+			free_irq(apbs[i].irq, &dummy);
+		iounmap(apbs[i].RamIO);
+	}
+	pci_disable_device(dev);
+	return ret ;
 }
 
 

[-- Attachment #3: Type: text/plain, Size: 167 bytes --]

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors

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

end of thread, other threads:[~2005-06-22  7:04 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-21 10:13 [KJ] [PATCH] Audit return code : drivers/char/applicom.c Christophe Lucas
2005-06-21 10:14 ` [KJ] [PATCH] Audit return code : drivers/char/lcd.c Christophe Lucas
2005-06-21 10:16 ` [KJ] [PATCH] Audit return code : drivers/input/misc/hp_sdc_rtc.c Christophe Lucas
2005-06-21 10:17 ` [KJ] [PATCH] Audit return code : drivers/macintosh/apm_emu.c Christophe Lucas
2005-06-21 19:24 ` [KJ] [PATCH] Audit return code : drivers/input/misc/hp_sdc_rtc.c Alexey Dobriyan
2005-06-21 19:30 ` [KJ] [PATCH] Audit return code : drivers/char/applicom.c randy_dunlap
2005-06-21 19:42 ` Alexey Dobriyan
2005-06-21 19:44 ` randy_dunlap
2005-06-21 21:09 ` [KJ] [PATCH] Audit return code : drivers/input/misc/hp_sdc_rtc.c Matthew Wilcox
2005-06-22  7:04 ` [KJ] [PATCH] Audit return code : drivers/char/applicom.c Christophe Lucas

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.