[SCTP]: Audit return code of create_proc_*
Christophe Lucas [Mon, 18 Jul 2005 20:38:07 +0000 (13:38 -0700)]
From: Christophe Lucas <clucas@rotomalug.org>

Audit return of create_proc_* functions.

Signed-off-by: Christophe Lucas <clucas@rotomalug.org>
Signed-off-by: Domen Puncer <domen@coderock.org>
Signed-off-by: David S. Miller <davem@davemloft.net>

net/sctp/objcnt.c

index 0781e5d..8ff588f 100644 (file)
@@ -127,8 +127,12 @@ done:
 /* Initialize the objcount in the proc filesystem.  */
 void sctp_dbg_objcnt_init(void)
 {
-       create_proc_read_entry("sctp_dbg_objcnt", 0, proc_net_sctp,
+       struct proc_dir_entry *ent;
+       ent = create_proc_read_entry("sctp_dbg_objcnt", 0, proc_net_sctp,
                               sctp_dbg_objcnt_read, NULL);
+       if (!ent)
+               printk(KERN_WARNING 
+                       "sctp_dbg_objcnt: Unable to create /proc entry.\n");
 }
 
 /* Cleanup the objcount entry in the proc filesystem.  */