Skip to content

Commit 682881e

Browse files
edumazetdavem330
authored andcommitted
net: sched: act_police: fix sparse errors in tcf_police_dump()
Fixes following sparse errors: net/sched/act_police.c:360:28: warning: dereference of noderef expression net/sched/act_police.c:362:45: warning: dereference of noderef expression net/sched/act_police.c:362:45: warning: dereference of noderef expression net/sched/act_police.c:368:28: warning: dereference of noderef expression net/sched/act_police.c:370:45: warning: dereference of noderef expression net/sched/act_police.c:370:45: warning: dereference of noderef expression net/sched/act_police.c:376:45: warning: dereference of noderef expression net/sched/act_police.c:376:45: warning: dereference of noderef expression Fixes: d1967e4 ("net_sched: act_police: add 2 new attributes to support police 64bit rate and peakrate") Signed-off-by: Eric Dumazet <[email protected]> Reviewed-by: Simon Horman <[email protected]> Acked-by: Jamal Hadi Salim <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent de9df6c commit 682881e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

net/sched/act_police.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -357,23 +357,23 @@ static int tcf_police_dump(struct sk_buff *skb, struct tc_action *a,
357357
opt.burst = PSCHED_NS2TICKS(p->tcfp_burst);
358358
if (p->rate_present) {
359359
psched_ratecfg_getrate(&opt.rate, &p->rate);
360-
if ((police->params->rate.rate_bytes_ps >= (1ULL << 32)) &&
360+
if ((p->rate.rate_bytes_ps >= (1ULL << 32)) &&
361361
nla_put_u64_64bit(skb, TCA_POLICE_RATE64,
362-
police->params->rate.rate_bytes_ps,
362+
p->rate.rate_bytes_ps,
363363
TCA_POLICE_PAD))
364364
goto nla_put_failure;
365365
}
366366
if (p->peak_present) {
367367
psched_ratecfg_getrate(&opt.peakrate, &p->peak);
368-
if ((police->params->peak.rate_bytes_ps >= (1ULL << 32)) &&
368+
if ((p->peak.rate_bytes_ps >= (1ULL << 32)) &&
369369
nla_put_u64_64bit(skb, TCA_POLICE_PEAKRATE64,
370-
police->params->peak.rate_bytes_ps,
370+
p->peak.rate_bytes_ps,
371371
TCA_POLICE_PAD))
372372
goto nla_put_failure;
373373
}
374374
if (p->pps_present) {
375375
if (nla_put_u64_64bit(skb, TCA_POLICE_PKTRATE64,
376-
police->params->ppsrate.rate_pkts_ps,
376+
p->ppsrate.rate_pkts_ps,
377377
TCA_POLICE_PAD))
378378
goto nla_put_failure;
379379
if (nla_put_u64_64bit(skb, TCA_POLICE_PKTBURST64,

0 commit comments

Comments
 (0)