s390/compat,uid16: use current_cred()
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Sat, 7 Sep 2013 08:19:55 +0000 (10:19 +0200)
committerHeiko Carstens <heiko.carstens@de.ibm.com>
Sat, 7 Sep 2013 09:58:21 +0000 (11:58 +0200)
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: Heiko Carstens <heiko.carstens@de.ibm.com>
arch/s390/kernel/compat_linux.c

index 8b6e4f5..1f1b8c7 100644 (file)
@@ -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;
 }