patch-2.4.13 linux/drivers/acpi/ospm/thermal/tz_osl.c

Next file: linux/drivers/block/DAC960.c
Previous file: linux/drivers/acpi/include/platform/acgcc.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.12/linux/drivers/acpi/ospm/thermal/tz_osl.c linux/drivers/acpi/ospm/thermal/tz_osl.c
@@ -177,7 +177,7 @@
 tz_osl_add_device(
 	TZ_CONTEXT		*thermal_zone)
 {
-	struct proc_dir_entry	*proc_entry = NULL;
+	struct proc_dir_entry	*proc_entry = NULL, *proc;
 
 	if (!thermal_zone) {
 		return(AE_BAD_PARAMETER);
@@ -186,15 +186,18 @@
 	printk("Thermal Zone: found\n");
 
 	proc_entry = proc_mkdir(thermal_zone->uid, tz_proc_root);
-	if (!proc_entry) {
+	if (!proc_entry)
 		return(AE_ERROR);
-	}
 
-	create_proc_read_entry(TZ_PROC_STATUS, S_IFREG | S_IRUGO,
+	proc = create_proc_read_entry(TZ_PROC_STATUS, S_IFREG | S_IRUGO,
 		proc_entry, tz_osl_proc_read_status, (void*)thermal_zone);
+	if (!proc)
+		return(AE_ERROR);
 
-	create_proc_read_entry(TZ_PROC_INFO, S_IFREG | S_IRUGO,
+	proc = create_proc_read_entry(TZ_PROC_INFO, S_IFREG | S_IRUGO,
 		proc_entry, tz_osl_proc_read_info, (void*)thermal_zone);
+	if (!proc)
+		return(AE_ERROR);
 
 	return(AE_OK);
 }

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)