Skip to content

Commit d34a166

Browse files
committed
net: convert to rcu_dereference_index_check()
The task_cls_classid() function applies rcu_dereference() to integers, which does not work with the shiny new sparse-based checking in rcu_dereference(). This commit therefore moves to the new RCU API rcu_dereference_index_check(). Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org> Acked-by: David S. Miller <davem@davemloft.net> Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent 763008c commit d34a166

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎include/net/cls_cgroup.h‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ static inline u32 task_cls_classid(struct task_struct *p)
4545
return 0;
4646

4747
rcu_read_lock();
48-
id = rcu_dereference(net_cls_subsys_id);
48+
id = rcu_dereference_index_check(net_cls_subsys_id,
49+
rcu_read_lock_held());
4950
if (id >= 0)
5051
classid = container_of(task_subsys_state(p, id),
5152
struct cgroup_cls_state, css)->classid;

0 commit comments

Comments
 (0)