Commit 7b26d82f authored by Hans-Joachim Picht's avatar Hans-Joachim Picht Committed by Martin Schwidefsky

[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: default avatarHans-Joachim Picht <hans@linux.vnet.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 9c95258c
...@@ -84,6 +84,7 @@ static int proc_handler_callhome(struct ctl_table *ctl, int write, ...@@ -84,6 +84,7 @@ static int proc_handler_callhome(struct ctl_table *ctl, int write,
rc = copy_from_user(buf, buffer, sizeof(buf)); rc = copy_from_user(buf, buffer, sizeof(buf));
if (rc != 0) if (rc != 0)
return -EFAULT; return -EFAULT;
buf[len - 1] = '\0';
if (strict_strtoul(buf, 0, &val) != 0) if (strict_strtoul(buf, 0, &val) != 0)
return -EINVAL; return -EINVAL;
if (val != 0 && val != 1) if (val != 0 && val != 1)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment