[patch 1/1] Audit return code of create_proc_*

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Christophe Lucas <[email protected]>


Audit return of create_proc_* functions.

Signed-off-by: Christophe Lucas <[email protected]>
Signed-off-by: Domen Puncer <[email protected]>
---
 ecard.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

Index: quilt/arch/arm26/kernel/ecard.c
===================================================================
--- quilt.orig/arch/arm26/kernel/ecard.c
+++ quilt/arch/arm26/kernel/ecard.c
@@ -522,9 +522,16 @@ 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)
+		printk(KERN_WARNING "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)
+			printk(KERN_WARNING "ecard: Unable to create proc entry\n");
+	}
 }
 
 #define ec_set_resource(ec,nr,st,sz,flg)			\

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux