diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2010-11-15 19:45:13 +0100 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2010-11-15 19:45:13 +0100 |
commit | c5d277d29ad1ae9add8d6984025ccd2e835971ce (patch) | |
tree | d829006da562f7f6ac1cdf983a56d26435e7093a /net/netfilter/nf_conntrack_extend.c | |
parent | ab0cba25128e1435a59b1ec4ae0c7505548fed87 (diff) | |
download | talos-obmc-linux-c5d277d29ad1ae9add8d6984025ccd2e835971ce.tar.gz talos-obmc-linux-c5d277d29ad1ae9add8d6984025ccd2e835971ce.zip |
netfilter: rcu sparse cleanups
Use RCU helpers to reduce number of sparse warnings
(CONFIG_SPARSE_RCU_POINTER=y), and adds lockdep checks.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'net/netfilter/nf_conntrack_extend.c')
-rw-r--r-- | net/netfilter/nf_conntrack_extend.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/net/netfilter/nf_conntrack_extend.c b/net/netfilter/nf_conntrack_extend.c index 920f9244388b..80a23ed62bb0 100644 --- a/net/netfilter/nf_conntrack_extend.c +++ b/net/netfilter/nf_conntrack_extend.c @@ -140,14 +140,16 @@ static void update_alloc_size(struct nf_ct_ext_type *type) /* This assumes that extended areas in conntrack for the types whose NF_CT_EXT_F_PREALLOC bit set are allocated in order */ for (i = min; i <= max; i++) { - t1 = nf_ct_ext_types[i]; + t1 = rcu_dereference_protected(nf_ct_ext_types[i], + lockdep_is_held(&nf_ct_ext_type_mutex)); if (!t1) continue; t1->alloc_size = ALIGN(sizeof(struct nf_ct_ext), t1->align) + t1->len; for (j = 0; j < NF_CT_EXT_NUM; j++) { - t2 = nf_ct_ext_types[j]; + t2 = rcu_dereference_protected(nf_ct_ext_types[j], + lockdep_is_held(&nf_ct_ext_type_mutex)); if (t2 == NULL || t2 == t1 || (t2->flags & NF_CT_EXT_F_PREALLOC) == 0) continue; |