public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: domen@coderock.org
To: rmk@arm.linux.org.uk
Cc: linux-kernel@vger.kernel.org, domen@coderock.org
Subject: [patch 1/1] arm/kernel: Audit return code of create_proc_*
Date: Fri, 15 Jul 2005 00:19:31 +0200	[thread overview]
Message-ID: <20050714221930.905863000@homer> (raw)

[-- Attachment #1: return_code-arch_arm_ --]
[-- Type: text/plain, Size: 1662 bytes --]

From: Christophe Lucas <clucas@rotomalug.org>


---
 apm.c   |    5 ++++-
 ecard.c |   14 ++++++++++++--
 2 files changed, 16 insertions(+), 3 deletions(-)

Index: quilt/arch/arm/kernel/apm.c
===================================================================
--- quilt.orig/arch/arm/kernel/apm.c
+++ quilt/arch/arm/kernel/apm.c
@@ -514,6 +514,7 @@ static int kapmd(void *arg)
 
 static int __init apm_init(void)
 {
+	struct proc_dir_entry *proc_entry;
 	int ret;
 
 	if (apm_disabled) {
@@ -535,7 +536,9 @@ static int __init apm_init(void)
 	}
 
 #ifdef CONFIG_PROC_FS
-	create_proc_info_entry("apm", 0, NULL, apm_get_info);
+	proc_entry = create_proc_info_entry("apm", 0, NULL, apm_get_info);
+	if (proc_entry == NULL)
+		printk(KERN_WARNING "apm: Unable to create apm proc entry.\n");
 #endif
 
 	ret = misc_register(&apm_device);
Index: quilt/arch/arm/kernel/ecard.c
===================================================================
--- quilt.orig/arch/arm/kernel/ecard.c
+++ quilt/arch/arm/kernel/ecard.c
@@ -776,9 +776,19 @@ static struct proc_dir_entry *proc_bus_e
 
 static void ecard_proc_init(void)
 {
+	struct proc_dir_entry *proc_entry;
+
 	proc_bus_ecard_dir = proc_mkdir("ecard", proc_bus);
-	create_proc_info_entry("devices", 0, proc_bus_ecard_dir,
-		get_ecard_dev_info);
+	if (proc_bus_ecard_dir == NULL)
+		printk(KERN_WARNING 
+			"ecard: Unable to create proc dir entry.\n");
+	else {
+		proc_entry = create_proc_info_entry("devices", 0, 
+			proc_bus_ecard_dir, get_ecard_dev_info);
+		if (proc_entry == NULL) 
+			printk(KERN_WARNING 
+				"ecard: Unable to create proc entry.\n");
+	}
 }
 
 #define ec_set_resource(ec,nr,st,sz)				\

--

                 reply	other threads:[~2005-07-14 22:20 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20050714221930.905863000@homer \
    --to=domen@coderock.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rmk@arm.linux.org.uk \
    /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