Skip to contentSkip to conversation

fix wrong return code of sysinfo_show() when get_zeroed_page() fails

PATCH New Jiecheng Wu 1 participant 1 message Aug 18, 2018 1 message not in the archive s390

lore
Share & tools
lore
#1 lore raw

PATCH 1/1 fix wrong return code of sysinfo_show() when get_zeroed_page() fails

In reply to a message not in the archive

Function sysinfo_show() defined in arch/s390/kernel/sysinfo.c returns wrong error code when function get_zeroed_page() fails. The correct return code when get_zeroed_page() fails is -ENOMEM but the code returns 0.

---
 arch/s390/kernel/sysinfo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/s390/kernel/sysinfo.c +1 -1
index 12f80d1..1da471f 100644
@@ -280,7 +280,7 @@ static int sysinfo_show(struct seq_file *m, void *v)
 	int level;
 
 	if (!info)
-		return 0;
+		return -ENOMEM;
 	level = stsi(NULL, 0, 0, 0);
 	if (level >= 1)
 		stsi_1_1_1(m, info);
Signature · 1 line
2.6.4