aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/sched/act_simple.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/net/sched/act_simple.c b/net/sched/act_simple.c
index aa51152e0066..18e4452574cd 100644
--- a/net/sched/act_simple.c
+++ b/net/sched/act_simple.c
@@ -156,10 +156,11 @@ static int tcf_simp_dump(struct sk_buff *skb, struct tc_action *a,
156 .index = d->tcf_index, 156 .index = d->tcf_index,
157 .refcnt = refcount_read(&d->tcf_refcnt) - ref, 157 .refcnt = refcount_read(&d->tcf_refcnt) - ref,
158 .bindcnt = atomic_read(&d->tcf_bindcnt) - bind, 158 .bindcnt = atomic_read(&d->tcf_bindcnt) - bind,
159 .action = d->tcf_action,
160 }; 159 };
161 struct tcf_t t; 160 struct tcf_t t;
162 161
162 spin_lock_bh(&d->tcf_lock);
163 opt.action = d->tcf_action;
163 if (nla_put(skb, TCA_DEF_PARMS, sizeof(opt), &opt) || 164 if (nla_put(skb, TCA_DEF_PARMS, sizeof(opt), &opt) ||
164 nla_put_string(skb, TCA_DEF_DATA, d->tcfd_defdata)) 165 nla_put_string(skb, TCA_DEF_DATA, d->tcfd_defdata))
165 goto nla_put_failure; 166 goto nla_put_failure;
@@ -167,9 +168,12 @@ static int tcf_simp_dump(struct sk_buff *skb, struct tc_action *a,
167 tcf_tm_dump(&t, &d->tcf_tm); 168 tcf_tm_dump(&t, &d->tcf_tm);
168 if (nla_put_64bit(skb, TCA_DEF_TM, sizeof(t), &t, TCA_DEF_PAD)) 169 if (nla_put_64bit(skb, TCA_DEF_TM, sizeof(t), &t, TCA_DEF_PAD))
169 goto nla_put_failure; 170 goto nla_put_failure;
171 spin_unlock_bh(&d->tcf_lock);
172
170 return skb->len; 173 return skb->len;
171 174
172nla_put_failure: 175nla_put_failure:
176 spin_unlock_bh(&d->tcf_lock);
173 nlmsg_trim(skb, b); 177 nlmsg_trim(skb, b);
174 return -1; 178 return -1;
175} 179}