From 7b26d82f5ea7de5667f87bb5ac6570111d7bff9f Mon Sep 17 00:00:00 2001
From: Hans-Joachim Picht <hans@linux.vnet.ibm.com>
Date: Wed, 24 Mar 2010 11:49:56 +0100
Subject: [PATCH] [S390] fix broken proc interface for sclp_async

This patch now allows the use of the proc interface to either activate
or deactivate call home on panic.
e.g.  echo 1 > /proc/sys/kernel/callhome
strict_strtoul() requires _either_'\n\0' _or_ '\0' termination.
This was missing and therefore the interface did not recognise valid input.

Signed-off-by: Hans-Joachim Picht <hans@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
---
 drivers/s390/char/sclp_async.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/s390/char/sclp_async.c b/drivers/s390/char/sclp_async.c
index 740fe405c3959..f449c696e5032 100644
--- a/drivers/s390/char/sclp_async.c
+++ b/drivers/s390/char/sclp_async.c
@@ -84,6 +84,7 @@ static int proc_handler_callhome(struct ctl_table *ctl, int write,
 		rc = copy_from_user(buf, buffer, sizeof(buf));
 		if (rc != 0)
 			return -EFAULT;
+		buf[len - 1] = '\0';
 		if (strict_strtoul(buf, 0, &val) != 0)
 			return -EINVAL;
 		if (val != 0 && val != 1)
-- 
GitLab