linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: domen@coderock.org
To: benh@kernel.crashing.org
Cc: linuxppc-dev@ozlabs.org, domen@coderock.org,
	Christophe Lucas <clucas@rotomalug.org>
Subject: [patch 1/1] Audit return code : drivers/macintosh/apm_emu.c
Date: Fri, 01 Jul 2005 00:03:50 +0200	[thread overview]
Message-ID: <20050630220349.966609000@> (raw)

From: Christophe Lucas <clucas@rotomalug.org>


Audit return codes (and handle failure correctly) for misc_register.

Signed-off-by: Christophe Lucas <clucas@rotomalug.org>
Signed-off-by: Domen Puncer <domen@coderock.org>


---
 apm_emu.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

Index: quilt/drivers/macintosh/apm_emu.c
===================================================================
--- quilt.orig/drivers/macintosh/apm_emu.c
+++ quilt/drivers/macintosh/apm_emu.c
@@ -515,19 +515,24 @@ static struct miscdevice apm_device = {
 
 static int __init apm_emu_init(void)
 {
+	int ret;
 	struct proc_dir_entry *apm_proc;
 
 	if (sys_ctrler != SYS_CTRLER_PMU) {
 		printk(KERN_INFO "apm_emu: Requires a machine with a PMU.\n");
 		return -ENODEV;
 	}
-		
+
+	ret = misc_register(&apm_device);
+	if (ret) {
+		printk(KERN_WARNING "apm_emu: Unable to register misc device.\n");
+		return ret;
+	}
+
 	apm_proc = create_proc_info_entry("apm", 0, NULL, apm_emu_get_info);
 	if (apm_proc)
 		apm_proc->owner = THIS_MODULE;
 
-	misc_register(&apm_device);
-
 	pmu_register_sleep_notifier(&apm_sleep_notifier);
 
 	printk(KERN_INFO "apm_emu: APM Emulation %s initialized.\n", driver_version);

--

             reply	other threads:[~2005-06-30 22:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-30 22:03 domen [this message]
2005-07-01  0:27 ` [patch 1/1] Audit return code : drivers/macintosh/apm_emu.c Stephen Rothwell
2005-07-01  0:51   ` Benjamin Herrenschmidt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050630220349.966609000@ \
    --to=domen@coderock.org \
    --cc=benh@kernel.crashing.org \
    --cc=clucas@rotomalug.org \
    --cc=linuxppc-dev@ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).