diff options
author | John Fastabend <john.fastabend@gmail.com> | 2014-09-16 02:30:49 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-09-16 15:59:36 -0400 |
commit | a96366bf263919c529baa74a0b029c82a8388045 (patch) | |
tree | a059526b1bb6064cdd1496aaa4a26069a300daef /net/sched/cls_u32.c | |
parent | 80aab73de4a076fc70ad5cc60395d935c40e605d (diff) |
net: sched: cls_u32 add missing rcu_assign_pointer and annotation
Add missing rcu_assign_pointer and missing annotation for ht_up
in cls_u32.c
Caught by kbuild bot,
>> net/sched/cls_u32.c:378:36: sparse: incorrect type in initializer (different address spaces)
net/sched/cls_u32.c:378:36: expected struct tc_u_hnode *ht
net/sched/cls_u32.c:378:36: got struct tc_u_hnode [noderef] <asn:4>*ht_up
>> net/sched/cls_u32.c:610:54: sparse: incorrect type in argument 4 (different address spaces)
net/sched/cls_u32.c:610:54: expected struct tc_u_hnode *ht
net/sched/cls_u32.c:610:54: got struct tc_u_hnode [noderef] <asn:4>*ht_up
>> net/sched/cls_u32.c:684:18: sparse: incorrect type in assignment (different address spaces)
net/sched/cls_u32.c:684:18: expected struct tc_u_hnode [noderef] <asn:4>*ht_up
net/sched/cls_u32.c:684:18: got struct tc_u_hnode *[assigned] ht
>> net/sched/cls_u32.c:359:18: sparse: dereference of noderef expression
Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/cls_u32.c')
-rw-r--r-- | net/sched/cls_u32.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c index 8cffe5a27007..eceeb0456d26 100644 --- a/net/sched/cls_u32.c +++ b/net/sched/cls_u32.c | |||
@@ -375,7 +375,7 @@ static int u32_delete_key(struct tcf_proto *tp, struct tc_u_knode *key) | |||
375 | { | 375 | { |
376 | struct tc_u_knode __rcu **kp; | 376 | struct tc_u_knode __rcu **kp; |
377 | struct tc_u_knode *pkp; | 377 | struct tc_u_knode *pkp; |
378 | struct tc_u_hnode *ht = key->ht_up; | 378 | struct tc_u_hnode *ht = rtnl_dereference(key->ht_up); |
379 | 379 | ||
380 | if (ht) { | 380 | if (ht) { |
381 | kp = &ht->ht[TC_U32_HASH(key->handle)]; | 381 | kp = &ht->ht[TC_U32_HASH(key->handle)]; |
@@ -607,7 +607,8 @@ static int u32_change(struct net *net, struct sk_buff *in_skb, | |||
607 | if (TC_U32_KEY(n->handle) == 0) | 607 | if (TC_U32_KEY(n->handle) == 0) |
608 | return -EINVAL; | 608 | return -EINVAL; |
609 | 609 | ||
610 | return u32_set_parms(net, tp, base, n->ht_up, n, tb, | 610 | return u32_set_parms(net, tp, base, |
611 | rtnl_dereference(n->ht_up), n, tb, | ||
611 | tca[TCA_RATE], ovr); | 612 | tca[TCA_RATE], ovr); |
612 | } | 613 | } |
613 | 614 | ||
@@ -681,7 +682,7 @@ static int u32_change(struct net *net, struct sk_buff *in_skb, | |||
681 | #endif | 682 | #endif |
682 | 683 | ||
683 | memcpy(&n->sel, s, sizeof(*s) + s->nkeys*sizeof(struct tc_u32_key)); | 684 | memcpy(&n->sel, s, sizeof(*s) + s->nkeys*sizeof(struct tc_u32_key)); |
684 | n->ht_up = ht; | 685 | RCU_INIT_POINTER(n->ht_up, ht); |
685 | n->handle = handle; | 686 | n->handle = handle; |
686 | n->fshift = s->hmask ? ffs(ntohl(s->hmask)) - 1 : 0; | 687 | n->fshift = s->hmask ? ffs(ntohl(s->hmask)) - 1 : 0; |
687 | tcf_exts_init(&n->exts, TCA_U32_ACT, TCA_U32_POLICE); | 688 | tcf_exts_init(&n->exts, TCA_U32_ACT, TCA_U32_POLICE); |