Skip to contentSkip to conversation

s390: sysinfo: check return value of create_proc_read_entry()

PATCH Applied Kulikov Vasiliy 1 participant 1 message Jul 28, 2010

Subsystems (2)

v1 of 2 Applied Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 2/10 s390: sysinfo: check return value of create_proc_read_entry()

create_proc_read_entry() may fail, if so return -ENOMEM.

---
 arch/s390/kernel/sysinfo.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
arch/s390/kernel/sysinfo.c +2 -3
index a0ffc77..db358e6 100644
@@ -231,9 +231,8 @@ static int proc_read_sysinfo(char *page, char **start,
 
 static __init int create_proc_sysinfo(void)
 {
-	create_proc_read_entry("sysinfo", 0444, NULL,
-			       proc_read_sysinfo, NULL);
-	return 0;
+	return create_proc_read_entry("sysinfo", 0444, NULL,
+			       proc_read_sysinfo, NULL) ? 0 : -ENOMEM;
 }
 device_initcall(create_proc_sysinfo);
 
Signature · 1 line
1.7.0.4