Skip to content

Commit 2ec7f4a

Browse files
committed
s390/compat,uid16: use current_cred()
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>
1 parent 7d6c3b4 commit 2ec7f4a

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

‎arch/s390/kernel/compat_linux.c‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,25 +221,26 @@ static int groups16_from_user(struct group_info *group_info, u16 __user *groupli
221221

222222
asmlinkage long sys32_getgroups16(int gidsetsize, u16 __user *grouplist)
223223
{
224+
const struct cred *cred = current_cred();
224225
int i;
225226

226227
if (gidsetsize < 0)
227228
return -EINVAL;
228229

229-
get_group_info(current->cred->group_info);
230-
i = current->cred->group_info->ngroups;
230+
get_group_info(cred->group_info);
231+
i = cred->group_info->ngroups;
231232
if (gidsetsize) {
232233
if (i > gidsetsize) {
233234
i = -EINVAL;
234235
goto out;
235236
}
236-
if (groups16_to_user(grouplist, current->cred->group_info)) {
237+
if (groups16_to_user(grouplist, cred->group_info)) {
237238
i = -EFAULT;
238239
goto out;
239240
}
240241
}
241242
out:
242-
put_group_info(current->cred->group_info);
243+
put_group_info(cred->group_info);
243244
return i;
244245
}
245246

0 commit comments

Comments
 (0)