aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/cred.c
diff options
context:
space:
mode:
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)
365 365
366 new = kmem_cache_alloc(cred_jar, GFP_ATOMIC); 366 new = kmem_cache_alloc(cred_jar, GFP_ATOMIC);
367 if (!new) 367 if (!new)
368 return NULL; 368 goto free_tgcred;
369 369
370 kdebug("prepare_usermodehelper_creds() alloc %p", new); 370 kdebug("prepare_usermodehelper_creds() alloc %p", new);
371 371
@@ -398,6 +398,10 @@ struct cred *prepare_usermodehelper_creds(void)
398 398
399error: 399error:
400 put_cred(new); 400 put_cred(new);
401free_tgcred:
402#ifdef CONFIG_KEYS
403 kfree(tgcred);
404#endif
401 return NULL; 405 return NULL;
402} 406}
403 407