From: Axel Lin Date: Tue, 23 Aug 2011 07:23:51 +0000 (+0800) Subject: CRED: fix build error due to 'tgcred' undeclared X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8ad346c62ae91e6376fb9d199ef8557b0c814209;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git 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 Acked-by: David Howells Signed-off-by: James Morris --- 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) if (!new) return NULL; +#ifdef CONFIG_KEYS tgcred = kmalloc(sizeof(*tgcred), GFP_KERNEL); if (!tgcred) { kmem_cache_free(cred_jar, new); return NULL; } +#endif kdebug("prepare_kernel_cred() alloc %p", new);