All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wang Chen <wangchen@cn.fujitsu.com>
To: "David S. Miller" <davem@davemloft.net>, NETDEV <netdev@vger.kernel.org>
Subject: [PATCH] [ATM]: Add error handling for proc_create fail
Date: Fri, 29 Feb 2008 15:43:24 +0800	[thread overview]
Message-ID: <47C7B79C.2010304@cn.fujitsu.com> (raw)

When proc_create() fail, we return -ENOMEM.

Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com>
---
 net/atm/clip.c |    4 ++++
 net/atm/lec.c  |    4 ++++
 2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/net/atm/clip.c b/net/atm/clip.c
index d30167c..57ed448 100644
--- a/net/atm/clip.c
+++ b/net/atm/clip.c
@@ -963,6 +963,10 @@ static int __init atm_clip_init(void)
 		struct proc_dir_entry *p;
 
 		p = proc_create("arp", S_IRUGO, atm_proc_root, &arp_seq_fops);
+		if (!p) {
+			printk(KERN_ERR "Unable to initialize /proc/atm/arp\n");
+			return -ENOMEM;
+		}
 	}
 #endif
 
diff --git a/net/atm/lec.c b/net/atm/lec.c
index 0e450d1..532965d 100644
--- a/net/atm/lec.c
+++ b/net/atm/lec.c
@@ -1250,6 +1250,10 @@ static int __init lane_module_init(void)
 	struct proc_dir_entry *p;
 
 	p = proc_create("lec", S_IRUGO, atm_proc_root, &lec_seq_fops);
+	if (!p) {
+		printk(KERN_ERR "Unable to initialize /proc/atm/lec\n");
+		return -ENOMEM;
+	}
 #endif
 
 	register_atm_ioctl(&lane_ioctl_ops);
-- 
WCN



             reply	other threads:[~2008-02-29  7:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-29  7:43 Wang Chen [this message]
2008-02-29 12:42 ` [PATCH] [ATM]: Add error handling for proc_create fail chas williams - CONTRACTOR
2008-02-29 18:38 ` David Miller
2008-03-03  2:44   ` take#2: " Wang Chen
2008-03-03  5:09     ` David Miller
2008-03-03  8:46       ` take#3: " Wang Chen
2008-03-04  7:27         ` take#4: " Wang Chen
2008-03-24  4:47           ` David Miller

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=47C7B79C.2010304@cn.fujitsu.com \
    --to=wangchen@cn.fujitsu.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.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 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.