diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2010-05-10 05:59:37 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2010-05-10 08:20:42 -0400 |
commit | dbb6be6d5e974c42bbecd183effaa0df69e1dd8b (patch) | |
tree | 5735cb47e70853d057a9881dd0ce44b83e88fa63 /kernel/cred.c | |
parent | 6a867a395558a7f882d041783e4cdea6744ca2bf (diff) | |
parent | b57f95a38233a2e73b679bea4a5453a1cc2a1cc9 (diff) |
Merge branch 'linus' into timers/core
Reason: Further posix_cpu_timer patches depend on mainline changes
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/cred.c')
-rw-r--r-- | kernel/cred.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/kernel/cred.c b/kernel/cred.c index 1ed8ca18790c..62af1816c235 100644 --- a/kernel/cred.c +++ b/kernel/cred.c | |||
@@ -10,6 +10,7 @@ | |||
10 | */ | 10 | */ |
11 | #include <linux/module.h> | 11 | #include <linux/module.h> |
12 | #include <linux/cred.h> | 12 | #include <linux/cred.h> |
13 | #include <linux/slab.h> | ||
13 | #include <linux/sched.h> | 14 | #include <linux/sched.h> |
14 | #include <linux/key.h> | 15 | #include <linux/key.h> |
15 | #include <linux/keyctl.h> | 16 | #include <linux/keyctl.h> |
@@ -364,7 +365,7 @@ struct cred *prepare_usermodehelper_creds(void) | |||
364 | 365 | ||
365 | new = kmem_cache_alloc(cred_jar, GFP_ATOMIC); | 366 | new = kmem_cache_alloc(cred_jar, GFP_ATOMIC); |
366 | if (!new) | 367 | if (!new) |
367 | return NULL; | 368 | goto free_tgcred; |
368 | 369 | ||
369 | kdebug("prepare_usermodehelper_creds() alloc %p", new); | 370 | kdebug("prepare_usermodehelper_creds() alloc %p", new); |
370 | 371 | ||
@@ -398,6 +399,12 @@ struct cred *prepare_usermodehelper_creds(void) | |||
398 | error: | 399 | error: |
399 | put_cred(new); | 400 | put_cred(new); |
400 | return NULL; | 401 | return NULL; |
402 | |||
403 | free_tgcred: | ||
404 | #ifdef CONFIG_KEYS | ||
405 | kfree(tgcred); | ||
406 | #endif | ||
407 | return NULL; | ||
401 | } | 408 | } |
402 | 409 | ||
403 | /* | 410 | /* |
@@ -786,8 +793,6 @@ bool creds_are_invalid(const struct cred *cred) | |||
786 | { | 793 | { |
787 | if (cred->magic != CRED_MAGIC) | 794 | if (cred->magic != CRED_MAGIC) |
788 | return true; | 795 | return true; |
789 | if (atomic_read(&cred->usage) < atomic_read(&cred->subscribers)) | ||
790 | return true; | ||
791 | #ifdef CONFIG_SECURITY_SELINUX | 796 | #ifdef CONFIG_SECURITY_SELINUX |
792 | if (selinux_is_enabled()) { | 797 | if (selinux_is_enabled()) { |
793 | if ((unsigned long) cred->security < PAGE_SIZE) | 798 | if ((unsigned long) cred->security < PAGE_SIZE) |