net, cgroup: cgroup_sk_updat_lock was missing initializer
authorTejun Heo <tj@kernel.org>
Mon, 14 Dec 2015 16:24:06 +0000 (11:24 -0500)
committerDavid S. Miller <davem@davemloft.net>
Mon, 14 Dec 2015 19:20:33 +0000 (14:20 -0500)
bd1060a1d671 ("sock, cgroup: add sock->sk_cgroup") added global
spinlock cgroup_sk_update_lock but erroneously skipped initializer
leading to uninitialized spinlock warning.  Fix it by using
DEFINE_SPINLOCK().

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Dexuan Cui <decui@microsoft.com>
Fixes: bd1060a1d671 ("sock, cgroup: add sock->sk_cgroup")
Signed-off-by: David S. Miller <davem@davemloft.net>
kernel/cgroup.c

index 4f8f7927b4222a98f924c2d8ac906888fe07210a..4466273f59e18c248ab64498e844af69f6dc1906 100644 (file)
@@ -5790,7 +5790,7 @@ EXPORT_SYMBOL_GPL(cgroup_get_from_path);
 
 #if defined(CONFIG_CGROUP_NET_PRIO) || defined(CONFIG_CGROUP_NET_CLASSID)
 
-spinlock_t cgroup_sk_update_lock;
+DEFINE_SPINLOCK(cgroup_sk_update_lock);
 static bool cgroup_sk_alloc_disabled __read_mostly;
 
 void cgroup_sk_alloc_disable(void)