Skip to contentSkip to conversation

CRED: fix build error due to 'tgcred' undeclared

PATCH In review Axel Lin 3 participants 3 messages Aug 23, 2011 Credentials

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 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

---
 kernel/cred.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
kernel/cred.c +2 -0
index bb2c0f5..5791612 100644
@@ -654,11 +654,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);
 
Signature · 1 line
1.7.4.1
Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines · Axel Lin

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

Quoted 1 line

James: do you want me to reissue my patches?

#2 lore raw
Quoted 13 lines · David Howells
Quoted 11 lines · Axel Lin

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

Quoted 3 lines
Quoted 1 line

Applied to
git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6#next

Quoted 2 lines

James: do you want me to reissue my patches?

Nope, I needed a differential patch as I'd already pushed that branch out.

Thanks.

Signature · 2 lines
James Morris
<[email protected]>