summaryrefslogtreecommitdiffstats
path: root/kernel/cred.c
diff options
context:
space:
mode:
authorJames Morris <jmorris@namei.org>2010-05-06 02:56:07 +0200
committerJames Morris <jmorris@namei.org>2010-05-06 02:56:07 +0200
commit0ffbe2699cda6afbe08501098dff8a8c2fe6ae09 (patch)
tree81b1a2305d16c873371b65c5a863c0268036cefe /kernel/cred.c
parentTOMOYO: Use GFP_NOFS rather than GFP_KERNEL. (diff)
parentMerge branch 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/air... (diff)
downloadlinux-0ffbe2699cda6afbe08501098dff8a8c2fe6ae09.tar.xz
linux-0ffbe2699cda6afbe08501098dff8a8c2fe6ae09.zip
Merge branch 'master' into next
Diffstat (limited to 'kernel/cred.c')
-rw-r--r--kernel/cred.c5
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 @@
*/
#include <linux/module.h>
#include <linux/cred.h>
+#include <linux/slab.h>
#include <linux/sched.h>
#include <linux/key.h>
#include <linux/keyctl.h>
@@ -397,6 +398,8 @@ struct cred *prepare_usermodehelper_creds(void)
error:
put_cred(new);
+ return NULL;
+
free_tgcred:
#ifdef CONFIG_KEYS
kfree(tgcred);
@@ -788,8 +791,6 @@ bool creds_are_invalid(const struct cred *cred)
{
if (cred->magic != CRED_MAGIC)
return true;
- if (atomic_read(&cred->usage) < atomic_read(&cred->subscribers))
- return true;
#ifdef CONFIG_SECURITY_SELINUX
if (selinux_is_enabled()) {
if ((unsigned long) cred->security < PAGE_SIZE)