diff options
author | James Morris <jmorris@namei.org> | 2010-05-05 20:56:07 -0400 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2010-05-05 20:56:07 -0400 |
commit | 0ffbe2699cda6afbe08501098dff8a8c2fe6ae09 (patch) | |
tree | 81b1a2305d16c873371b65c5a863c0268036cefe /kernel/cred.c | |
parent | 4e5d6f7ec3833c0da9cf34fa5c53c6058c5908b6 (diff) | |
parent | 7ebd467551ed6ae200d7835a84bbda0dcadaa511 (diff) |
Merge branch 'master' into next
Diffstat (limited to 'kernel/cred.c')
-rw-r--r-- | kernel/cred.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/kernel/cred.c b/kernel/cred.c index fecb34640482..31f38a99adf7 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> |
@@ -397,6 +398,8 @@ struct cred *prepare_usermodehelper_creds(void) | |||
397 | 398 | ||
398 | error: | 399 | error: |
399 | put_cred(new); | 400 | put_cred(new); |
401 | return NULL; | ||
402 | |||
400 | free_tgcred: | 403 | free_tgcred: |
401 | #ifdef CONFIG_KEYS | 404 | #ifdef CONFIG_KEYS |
402 | kfree(tgcred); | 405 | kfree(tgcred); |
@@ -788,8 +791,6 @@ bool creds_are_invalid(const struct cred *cred) | |||
788 | { | 791 | { |
789 | if (cred->magic != CRED_MAGIC) | 792 | if (cred->magic != CRED_MAGIC) |
790 | return true; | 793 | return true; |
791 | if (atomic_read(&cred->usage) < atomic_read(&cred->subscribers)) | ||
792 | return true; | ||
793 | #ifdef CONFIG_SECURITY_SELINUX | 794 | #ifdef CONFIG_SECURITY_SELINUX |
794 | if (selinux_is_enabled()) { | 795 | if (selinux_is_enabled()) { |
795 | if ((unsigned long) cred->security < PAGE_SIZE) | 796 | if ((unsigned long) cred->security < PAGE_SIZE) |