Commit 2ec7f4ae authored by Heiko Carstens's avatar Heiko Carstens

s390/compat,uid16: use current_cred()

86a264ab "CRED: Wrap current->cred and a few other accessors" converted
all uses of current->cred into current_cred() but left s390 alone.

So let's convert s390 finally as well, only five years later.

This way we also get rid of a sparse warning which complains about a
possible invalid rcu dereference which however is a false positive.
Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
parent 7d6c3b49
...@@ -221,25 +221,26 @@ static int groups16_from_user(struct group_info *group_info, u16 __user *groupli ...@@ -221,25 +221,26 @@ static int groups16_from_user(struct group_info *group_info, u16 __user *groupli
asmlinkage long sys32_getgroups16(int gidsetsize, u16 __user *grouplist) asmlinkage long sys32_getgroups16(int gidsetsize, u16 __user *grouplist)
{ {
const struct cred *cred = current_cred();
int i; int i;
if (gidsetsize < 0) if (gidsetsize < 0)
return -EINVAL; return -EINVAL;
get_group_info(current->cred->group_info); get_group_info(cred->group_info);
i = current->cred->group_info->ngroups; i = cred->group_info->ngroups;
if (gidsetsize) { if (gidsetsize) {
if (i > gidsetsize) { if (i > gidsetsize) {
i = -EINVAL; i = -EINVAL;
goto out; goto out;
} }
if (groups16_to_user(grouplist, current->cred->group_info)) { if (groups16_to_user(grouplist, cred->group_info)) {
i = -EFAULT; i = -EFAULT;
goto out; goto out;
} }
} }
out: out:
put_group_info(current->cred->group_info); put_group_info(cred->group_info);
return i; return i;
} }
......
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