diff options
author | Jeff Garzik <jeff@garzik.org> | 2006-07-24 03:40:11 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-07-24 03:40:11 -0400 |
commit | d11ea48aab3b57cc931cc7120603e1c2ffb04302 (patch) | |
tree | dad3c780816d0a76e021ee53c49c7c1fb4dd1243 /arch/sparc/kernel/sys_sparc.c | |
parent | 22ad852b8297e5063fc50f54a77e13f6d9b16a6f (diff) | |
parent | abb5a5cc6bba1516403146c5b79036fe843beb70 (diff) |
Merge branch 'master' into upstream
Diffstat (limited to 'arch/sparc/kernel/sys_sparc.c')
-rw-r--r-- | arch/sparc/kernel/sys_sparc.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/arch/sparc/kernel/sys_sparc.c b/arch/sparc/kernel/sys_sparc.c index 0cdfc9d294b..a41c8a5c200 100644 --- a/arch/sparc/kernel/sys_sparc.c +++ b/arch/sparc/kernel/sys_sparc.c @@ -465,21 +465,21 @@ sys_rt_sigaction(int sig, asmlinkage int sys_getdomainname(char __user *name, int len) { - int nlen; - int err = -EFAULT; + int nlen, err; + if (len < 0 || len > __NEW_UTS_LEN) + return -EINVAL; + down_read(&uts_sem); nlen = strlen(system_utsname.domainname) + 1; - if (nlen < len) len = nlen; - if (len > __NEW_UTS_LEN) - goto done; - if (copy_to_user(name, system_utsname.domainname, len)) - goto done; - err = 0; -done: + + err = -EFAULT; + if (!copy_to_user(name, system_utsname.domainname, len)) + err = 0; + up_read(&uts_sem); return err; } |