Skip to contentSkip to conversation

linux-2.6.15-rc2 apm_emu.c audit misc_register() ret. code

PATCH Applied Paolo Teti 3 participants 7 messages Nov 23, 2005 – Nov 28, 2005

Subsystems (2)
lore
Share & tools
lore

Paolo Teti

author
#0 lore raw

PATCH 1/1 linux-2.6.15-rc2 apm_emu.c audit misc_register() ret. code

from: Paolo Teti

fix a missing check on misc_register() return code

---

drivers/macintosh/apm_emu.c renamed from drivers/macintosh/apm_emu.c.orig +5 -1
@@ -530,7 +530,11 @@ static int __init apm_emu_init(void)
 	if (apm_proc)
 		apm_proc->owner = THIS_MODULE;
 
-	misc_register(&apm_device);
+	if (misc_register(&apm_device) != 0) {
+		remove_proc_entry("apm", NULL);
+		printk(KERN_ERR "apm_emu: Failed to register APM Emulation.\n");
+		return -ENODEV;
+	}
 
 	pmu_register_sleep_notifier(&apm_sleep_notifier);
 

_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors

#1 lore raw

Re: [KJ][PATCH] linux-2.6.15-rc2 apm_emu.c audit misc_register() ret.

Quoted 11 lines · Paolo Teti

from: Paolo Teti

fix a missing check on misc_register() return code

---

drivers/macintosh/apm_emu.c renamed from drivers/macintosh/apm_emu.c.orig +0 -0
@@ -530,7 +530,11 @@ static int __init apm_emu_init(void)
 	if (apm_proc)

drivers/macintosh/apm_emu.c static int __init apm_emu_init(void) · line 539

Quoted 10 lines
drivers/macintosh/apm_emu.c renamed from drivers/macintosh/apm_emu.c.orig +5 -1
 		apm_proc->owner = THIS_MODULE;
 
-	misc_register(&apm_device);
+	if (misc_register(&apm_device) != 0) {
+		remove_proc_entry("apm", NULL);
+		printk(KERN_ERR "apm_emu: Failed to register APM Emulation.\n");
+		return -ENODEV;
+	}
 
 	pmu_register_sleep_notifier(&apm_sleep_notifier);

Good retry :)

Already done here :

	http://lists.osdl.org/pipermail/kernel-janitors/2005-June/004243.html

Have a nice day,

- Christophe ([email protected])

_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors

author
#2 lore raw

Re: [KJ][PATCH] linux-2.6.15-rc2 apm_emu.c audit misc_register() ret.

In reply to Paolo Teti

2005/11/24, Christophe Lucas <[email protected]>:

Quoted 8 lines

Good retry :)

Already done here :

        http://lists.osdl.org/pipermail/kernel-janitors/2005-June/004243.html

Have a nice day,

Oops!
Yes it's true!... some _minor_ difference but the patch it's the same.

Pao

_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors

#3 lore raw

Re: [KJ][PATCH] linux-2.6.15-rc2 apm_emu.c audit misc_register() ret.

In reply to Paolo Teti
Quoted 7 lines · Christophe Lucas
Quoted 6 lines · Paolo Teti
drivers/macintosh/apm_emu.c renamed from drivers/macintosh/apm_emu.c.orig +0 -0
@@ -530,7 +530,11 @@ static int __init apm_emu_init(void)
 	if (apm_proc)
 		apm_proc->owner = THIS_MODULE;
 
Quoted 6 lines

drivers/macintosh/apm_emu.c static int __init apm_emu_init(void) · line 537

Quoted 6 lines
drivers/macintosh/apm_emu.c renamed from drivers/macintosh/apm_emu.c.orig +5 -1
-	misc_register(&apm_device);
+	if (misc_register(&apm_device) != 0) {
+		remove_proc_entry("apm", NULL);
+		printk(KERN_ERR "apm_emu: Failed to register APM Emulation.\n");
+		return -ENODEV;
+	}

applied, thanks.

Quoted 8 lines

drivers/macintosh/apm_emu.c static int __init apm_emu_init(void) · line 539

Quoted 1 line
drivers/macintosh/apm_emu.c renamed from drivers/macintosh/apm_emu.c.orig +0 -0
 	pmu_register_sleep_notifier(&apm_sleep_notifier);

Good retry :)

Already done here :

	http://lists.osdl.org/pipermail/kernel-janitors/2005-June/004243.html

[You sort your patch collection. Nothing happens.]

Speaking of your patch, it shouldn't use KERN_WARNING and should (minor nitpick) test for "< 0", not "!= 0".

_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors

author
#4 lore raw

Re: [KJ][PATCH] linux-2.6.15-rc2 apm_emu.c audit misc_register() ret.

In reply to Paolo Teti
Quoted 4 lines

Speaking of your patch, it shouldn't use KERN_WARNING and should (minor nitpick) test for "< 0", not "!= 0".

Why?
Looking at misc_register function the rule is

"A zero is returned on success and a negative errno code for failure."

So test for !=0 is also correct!!

Sorry probably because I have used Ccr instead of Cc I have also sent this patch to Benjamin Herrenschmidt ( the ppc APM manteiner) and now this patch is on the -mm
tree as show below!

Sorry!!

----
The patch titled

apm_emu.c: fix a missing check on misc_register() return code

has been added to the -mm tree. Its filename is

apm_emuc-fix-a-missing-check-on-misc_register-return-code.patch

From: Paolo Teti <[email protected]>

fix a missing check on misc_register() return code

Cc Benjamin Herrenschmidt <[email protected]>

Acked by: Benjamin Herrenschmidt <[email protected]>

_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors

#5 lore raw

Re: [KJ][PATCH] linux-2.6.15-rc2 apm_emu.c audit misc_register() ret.

In reply to Paolo Teti
Quoted 10 lines · Paolo Teti
Quoted 4 lines

Speaking of your patch, it shouldn't use KERN_WARNING and should (minor nitpick) test for "< 0", not "!= 0".

Why?
Looking at misc_register function the rule is

"A zero is returned on success and a negative errno code for failure."

Quoted 8 lines

So test for !=0 is also correct!!

Sorry probably because I have used Ccr instead of Cc I have also sent this patch to Benjamin Herrenschmidt ( the ppc APM manteiner) and now this patch is on the -mm
tree as show below!

Sorry!!

You don't have to be sorry. It is about my patch Alexey say that.

I understand your reply Alexey. I would have prefered to know that in July 2005 not in November 2005.

Have a nice day,

- Christophe ([email protected])

_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors

author
#6 lore raw

Re: [KJ][PATCH] linux-2.6.15-rc2 apm_emu.c audit misc_register() ret.

In reply to Paolo Teti
Quoted 7 lines
Quoted 1 line

Sorry!!

You don't have to be sorry. It is about my patch Alexey say that.

I understand your reply Alexey. I would have prefered to know that in July 2005 not in November 2005.

Ok. Christophe

but I have asked "sorry" because I have sent also to Benjamin the patch (probably I have used Ccr instead of Cc) and know the patch is in the -mm tree checked by Benjamin

Hi, Pao

_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors