[patch 1/1] arm/kernel: Audit return code of create_proc_*

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

 



From: Christophe Lucas <[email protected]>


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

--
-
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]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux