]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - kernel/user.c
gpio: omap: fix lack of irqstatus_raw0 for OMAP4
[linux.git] / kernel / user.c
index 0df9b1640b2af5d4ade21a376172fdfd6d097694..78b17e36e705c2b81f76637b327c7f5a79e194ad 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-only
 /*
  * The "user cache".
  *
@@ -185,7 +186,7 @@ struct user_struct *alloc_uid(kuid_t uid)
        if (!up) {
                new = kmem_cache_zalloc(uid_cachep, GFP_KERNEL);
                if (!new)
-                       goto out_unlock;
+                       return NULL;
 
                new->uid = uid;
                refcount_set(&new->__count, 1);
@@ -199,8 +200,6 @@ struct user_struct *alloc_uid(kuid_t uid)
                spin_lock_irq(&uidhash_lock);
                up = uid_hash_find(uid, hashent);
                if (up) {
-                       key_put(new->uid_keyring);
-                       key_put(new->session_keyring);
                        kmem_cache_free(uid_cachep, new);
                } else {
                        uid_hash_insert(new, hashent);
@@ -210,9 +209,6 @@ struct user_struct *alloc_uid(kuid_t uid)
        }
 
        return up;
-
-out_unlock:
-       return NULL;
 }
 
 static int __init uid_cache_init(void)