Skip to content

Commit

Permalink
s390/compat,uid16: use current_cred()
Browse files Browse the repository at this point in the history
86a264a "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: Heiko Carstens <heiko.carstens@de.ibm.com>
  • Loading branch information
Heiko Carstens committed Sep 7, 2013
1 parent 7d6c3b4 commit 2ec7f4a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions arch/s390/kernel/compat_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
const struct cred *cred = current_cred();
int i;

if (gidsetsize < 0)
return -EINVAL;

get_group_info(current->cred->group_info);
i = current->cred->group_info->ngroups;
get_group_info(cred->group_info);
i = cred->group_info->ngroups;
if (gidsetsize) {
if (i > gidsetsize) {
i = -EINVAL;
goto out;
}
if (groups16_to_user(grouplist, current->cred->group_info)) {
if (groups16_to_user(grouplist, cred->group_info)) {
i = -EFAULT;
goto out;
}
}
out:
put_group_info(current->cred->group_info);
put_group_info(cred->group_info);
return i;
}

Expand Down

0 comments on commit 2ec7f4a

Please sign in to comment.