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,
if (copy_to_user(to, from, len))
return -EFAULT;
off = len < to_size? len: len - 1;
if (dotchop) {
off = (strnchr(from, len, '.') - from);
} else{
off = len - 1;
const char *p = strnchr(from, len, '.');
if (p) off = p - from;
}
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