mmc: dw_mmc: fix unmap sg twice when finding data err
[firefly-linux-kernel-4.4.55.git] / kernel / groups.c
index 67b4ba30475fbc2b902e5a6226aeac2d2aaa5803..74d431d252515042296bb739cb8aba456635113e 100644 (file)
@@ -9,9 +9,6 @@
 #include <linux/user_namespace.h>
 #include <asm/uaccess.h>
 
-/* init to 2 - one for init_task, one to ensure it is never freed */
-struct group_info init_groups = { .usage = ATOMIC_INIT(2) };
-
 struct group_info *groups_alloc(int gidsetsize)
 {
        struct group_info *group_info;
@@ -158,17 +155,13 @@ int groups_search(const struct group_info *group_info, kgid_t grp)
  * set_groups - Change a group subscription in a set of credentials
  * @new: The newly prepared set of credentials to alter
  * @group_info: The group list to install
- *
- * Validate a group subscription and, if valid, insert it into a set
- * of credentials.
  */
-int set_groups(struct cred *new, struct group_info *group_info)
+void set_groups(struct cred *new, struct group_info *group_info)
 {
        put_group_info(new->group_info);
        groups_sort(group_info);
        get_group_info(group_info);
        new->group_info = group_info;
-       return 0;
 }
 
 EXPORT_SYMBOL(set_groups);
@@ -183,18 +176,12 @@ EXPORT_SYMBOL(set_groups);
 int set_current_groups(struct group_info *group_info)
 {
        struct cred *new;
-       int ret;
 
        new = prepare_creds();
        if (!new)
                return -ENOMEM;
 
-       ret = set_groups(new, group_info);
-       if (ret < 0) {
-               abort_creds(new);
-               return ret;
-       }
-
+       set_groups(new, group_info);
        return commit_creds(new);
 }