Commit a4475157 authored by Alexander Stohr's avatar Alexander Stohr Committed by Linus Torvalds

[SPARC64]: Fix solaris emul __set_utsfield offset calculation.

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 974befea
...@@ -148,10 +148,10 @@ static int __set_utsfield(char __user *to, int to_size, ...@@ -148,10 +148,10 @@ static int __set_utsfield(char __user *to, int to_size,
if (copy_to_user(to, from, len)) if (copy_to_user(to, from, len))
return -EFAULT; return -EFAULT;
off = len < to_size? len: len - 1;
if (dotchop) { if (dotchop) {
off = (strnchr(from, len, '.') - from); const char *p = strnchr(from, len, '.');
} else{ if (p) off = p - from;
off = len - 1;
} }
if (__put_user('\0', to + off)) if (__put_user('\0', to + off))
......
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