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

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

description:
Audit return codes (and handle failure correctly) for misc_register.
"unsigned int" is preferred to "int".

Signed-off-by: Christophe Lucas <clucas@rotomalug.org>


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-22 08:55:52.000000000 +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,11 @@ int __init applicom_init(void)
 	DeviceErrorCount = 0;
 
 	if (numboards) {
-		misc_register(&ac_miscdev);
+		ret = misc_register(&ac_miscdev);
+		if (ret) {
+			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 +341,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 #2: 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] 9+ messages in thread

end of thread, other threads:[~2005-06-23  8:46 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-22  7:53 [KJ] [PATCH] [RESEND] Audit return code : drivers/char/applicom.c Christophe Lucas
2005-06-22  7:56 ` [KJ] [PATCH] [RESEND] Audit return code : drivers/char/lcd.c Christophe Lucas
2005-06-22 15:49 ` randy_dunlap
2005-06-22 16:22 ` [KJ] [PATCH] [RESEND] Audit return code : drivers/char/applicom.c randy_dunlap
2005-06-22 16:25 ` [KJ] [PATCH] [RESEND] Audit return code : drivers/char/lcd.c randy_dunlap
2005-06-23  7:17 ` [KJ] [PATCH] [RESEND] Audit return code : drivers/char/applicom.c Christophe Lucas
2005-06-23  7:18 ` [KJ] [PATCH] [RESEND] Audit return code : drivers/char/lcd.c Christophe Lucas
2005-06-23  7:40 ` [KJ] [PATCH] [RESEND] Audit return code : drivers/char/applicom.c Felipe W Damasio
2005-06-23  8:46 ` 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.