Re: linux-next: build warning in Linus' tree

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Herbert Xu
Date: Tuesday, May 25, 2010 - 6:51 pm

On Wed, May 26, 2010 at 11:43:06AM +1000, Stephen Rothwell wrote:

This is a genuine bug.  I don't know why my gcc didn't warn about
it.

cls_cgroup: Initialise classid when module is absent

When the cls_cgroup module is not loaded, task_cls_classid will
return an uninitialised classid instead of zero.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

diff --git a/include/net/cls_cgroup.h b/include/net/cls_cgroup.h
index 6cf4486..726cc35 100644
--- a/include/net/cls_cgroup.h
+++ b/include/net/cls_cgroup.h
@@ -39,7 +39,7 @@ extern int net_cls_subsys_id;
 static inline u32 task_cls_classid(struct task_struct *p)
 {
 	int id;
-	u32 classid;
+	u32 classid = 0;
 
 	if (in_interrupt())
 		return 0;

Thanks,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
linux-next: build warning in Linus' tree, Stephen Rothwell, (Tue May 25, 6:43 pm)
Re: linux-next: build warning in Linus' tree, Herbert Xu, (Tue May 25, 6:51 pm)
Re: linux-next: build warning in Linus' tree, David Miller, (Tue May 25, 6:54 pm)