瀏覽代碼

[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>
Hans-Joachim Picht 15 年之前
父節點
當前提交
7b26d82f5e
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      drivers/s390/char/sclp_async.c

+ 1 - 0
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)