summaryrefslogtreecommitdiffstats
path: root/kernel/cred.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2010-04-05 04:37:28 +0200
committerTejun Heo <tj@kernel.org>2010-04-05 04:37:28 +0200
commit336f5899d287f06d8329e208fc14ce50f7ec9698 (patch)
tree9b762d450d5eb248a6ff8317badb7e223d93ed58 /kernel/cred.c
parentstaging/otus: include slab.h from usbdrv.h (diff)
parentMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6 (diff)
downloadlinux-336f5899d287f06d8329e208fc14ce50f7ec9698.tar.xz
linux-336f5899d287f06d8329e208fc14ce50f7ec9698.zip
Merge branch 'master' into export-slabh
Diffstat (limited to 'kernel/cred.c')
-rw-r--r--kernel/cred.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/kernel/cred.c b/kernel/cred.c
index d84bdef17c9f..e1dbe9eef800 100644
--- a/kernel/cred.c
+++ b/kernel/cred.c
@@ -365,7 +365,7 @@ struct cred *prepare_usermodehelper_creds(void)
new = kmem_cache_alloc(cred_jar, GFP_ATOMIC);
if (!new)
- return NULL;
+ goto free_tgcred;
kdebug("prepare_usermodehelper_creds() alloc %p", new);
@@ -398,6 +398,10 @@ struct cred *prepare_usermodehelper_creds(void)
error:
put_cred(new);
+free_tgcred:
+#ifdef CONFIG_KEYS
+ kfree(tgcred);
+#endif
return NULL;
}