diff options
author | Tejun Heo <tj@kernel.org> | 2016-12-27 20:49:09 +0100 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2016-12-27 20:49:09 +0100 |
commit | e0aed7c74f0bf6c643103f3a10ff988b7ee6545a (patch) | |
tree | b35d04595b30594bf4d9fac4759d10a2570590e1 /kernel/cgroup/cgroup-v1.c | |
parent | cgroup: move namespace code to kernel/cgroup/namespace.c (diff) | |
download | linux-e0aed7c74f0bf6c643103f3a10ff988b7ee6545a.tar.xz linux-e0aed7c74f0bf6c643103f3a10ff988b7ee6545a.zip |
cgroup: fix RCU related sparse warnings
kn->priv which is a void * is used as a RCU pointer by cgroup. When
dereferencing it, it was passing kn->priv to rcu_derefreence() without
casting it into a RCU pointer triggering address space mismatch
warning from sparse. Fix them.
Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Acked-by: Acked-by: Zefan Li <lizefan@huawei.com>
Diffstat (limited to 'kernel/cgroup/cgroup-v1.c')
-rw-r--r-- | kernel/cgroup/cgroup-v1.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/cgroup/cgroup-v1.c b/kernel/cgroup/cgroup-v1.c index 37be09e09740..465b10111eaf 100644 --- a/kernel/cgroup/cgroup-v1.c +++ b/kernel/cgroup/cgroup-v1.c @@ -694,7 +694,7 @@ int cgroupstats_build(struct cgroupstats *stats, struct dentry *dentry) * @kn->priv is RCU safe. Let's do the RCU dancing. */ rcu_read_lock(); - cgrp = rcu_dereference(kn->priv); + cgrp = rcu_dereference(*(void __rcu __force **)&kn->priv); if (!cgrp || cgroup_is_dead(cgrp)) { rcu_read_unlock(); mutex_unlock(&cgroup_mutex); |