All of lore.kernel.org
 help / color / mirror / Atom feed
* [KJ] [PATCH] Audit return code :
@ 2005-06-21 10:18 Christophe Lucas
  2005-06-21 19:32 ` Alexey Dobriyan
  2005-06-22  7:07 ` Christophe Lucas
  0 siblings, 2 replies; 3+ messages in thread
From: Christophe Lucas @ 2005-06-21 10:18 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_misc_hdpuftrs_hdpu_cpustate.c.diff --]
[-- Type: text/plain, Size: 974 bytes --]

diff -urpNX dontdiff 2.6.12-orig/drivers/misc/hdpuftrs/hdpu_cpustate.c 2.6.12/drivers/misc/hdpuftrs/hdpu_cpustate.c
--- 2.6.12-orig/drivers/misc/hdpuftrs/hdpu_cpustate.c	2005-06-17 21:48:29.000000000 +0200
+++ 2.6.12/drivers/misc/hdpuftrs/hdpu_cpustate.c	2005-06-21 11:38:33.783957664 +0200
@@ -192,12 +192,19 @@ static int hdpu_cpustate_probe(struct de
 {
 	struct platform_device *pdev = to_platform_device(ddev);
 	struct resource *res;
+	int ret;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	cpustate.set_addr = (unsigned long *)res->start;
 	cpustate.clr_addr = (unsigned long *)res->end - 1;
 
-	misc_register(&cpustate_dev);
+	if (ret = misc_register(&cpustate_dev)) {
+		printk(KERN_WARNING "Unable to register misc device.\n");
+		cpustate.set_addr = 0;
+		cpustate.clr_addr = 0;
+		return ret ;
+	}
+
 	create_proc_read_entry("sky_cpustate", 0, 0, cpustate_read_proc, NULL);
 
 	printk(KERN_INFO "Sky CPU State Driver v" SKY_CPUSTATE_VERSION "\n");

[-- 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] 3+ messages in thread

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

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-21 10:18 [KJ] [PATCH] Audit return code : Christophe Lucas
2005-06-21 19:32 ` Alexey Dobriyan
2005-06-22  7:07 ` 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.