aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/cred.c
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2011-08-23 03:23:51 -0400
committerJames Morris <jmorris@namei.org>2011-08-23 04:22:28 -0400
commit8ad346c62ae91e6376fb9d199ef8557b0c814209 (patch)
treec82ec8caf44c76b43728836c2d53704268c4b8d0 /kernel/cred.c
parent0c061b5707ab84ebfe8f18f1c9c3110ae5cd6073 (diff)
CRED: fix build error due to 'tgcred' undeclared
This patch adds CONFIG_KEYS guard for tgcred to fix below build error if CONFIG_KEYS is not configured. CC kernel/cred.o kernel/cred.c: In function 'prepare_kernel_cred': kernel/cred.c:657: error: 'tgcred' undeclared (first use in this function) kernel/cred.c:657: error: (Each undeclared identifier is reported only once kernel/cred.c:657: error: for each function it appears in.) make[1]: *** [kernel/cred.o] Error 1 make: *** [kernel] Error 2 Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: David Howells <dhowells@redhat.com> Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'kernel/cred.c')
-rw-r--r--kernel/cred.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/cred.c b/kernel/cred.c
index f1e22556bc49..d84fc910e2f3 100644
--- a/kernel/cred.c
+++ b/kernel/cred.c
@@ -656,11 +656,13 @@ struct cred *prepare_kernel_cred(struct task_struct *daemon)
656 if (!new) 656 if (!new)
657 return NULL; 657 return NULL;
658 658
659#ifdef CONFIG_KEYS
659 tgcred = kmalloc(sizeof(*tgcred), GFP_KERNEL); 660 tgcred = kmalloc(sizeof(*tgcred), GFP_KERNEL);
660 if (!tgcred) { 661 if (!tgcred) {
661 kmem_cache_free(cred_jar, new); 662 kmem_cache_free(cred_jar, new);
662 return NULL; 663 return NULL;
663 } 664 }
665#endif
664 666
665 kdebug("prepare_kernel_cred() alloc %p", new); 667 kdebug("prepare_kernel_cred() alloc %p", new);
666 668