netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [ATM]: Add error handling for proc_create fail
@ 2008-02-29  7:43 Wang Chen
  2008-02-29 12:42 ` chas williams - CONTRACTOR
  2008-02-29 18:38 ` David Miller
  0 siblings, 2 replies; 8+ messages in thread
From: Wang Chen @ 2008-02-29  7:43 UTC (permalink / raw)
  To: David S. Miller, NETDEV

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



^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2008-03-24  4:47 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-29  7:43 [PATCH] [ATM]: Add error handling for proc_create fail Wang Chen
2008-02-29 12:42 ` 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

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).