[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190827115031.43fcbac5@redhat.com>
Date: Tue, 27 Aug 2019 11:50:31 +0200
From: Stefano Brivio <sbrivio@...hat.com>
To: Davide Caratti <dcaratti@...hat.com>
Cc: Cong Wang <xiyou.wangcong@...il.com>,
Jamal Hadi Salim <jhs@...atatu.com>,
Jiri Pirko <jiri@...nulli.us>,
"David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org,
Paolo Abeni <pabeni@...hat.com>, Li Shuang <shuali@...hat.com>
Subject: Re: [PATCH net] net/sched: pfifo_fast: fix wrong dereference when
qdisc is reset
On Tue, 27 Aug 2019 01:15:16 +0200
Davide Caratti <dcaratti@...hat.com> wrote:
> diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
> index 11c03cf4aa74..c89b787785a1 100644
> --- a/net/sched/sch_generic.c
> +++ b/net/sched/sch_generic.c
> @@ -688,12 +688,14 @@ static void pfifo_fast_reset(struct Qdisc *qdisc)
> kfree_skb(skb);
> }
>
> - for_each_possible_cpu(i) {
> - struct gnet_stats_queue *q = per_cpu_ptr(qdisc->cpu_qstats, i);
> + if (qdisc_is_percpu_stats(qdisc))
This needs curly brackets, as the block has multiple lines (for coding
style only).
> + for_each_possible_cpu(i) {
> + struct gnet_stats_queue *q =
> + per_cpu_ptr(qdisc->cpu_qstats, i);
And you could split declaration and assignment here, it takes two lines
anyway and becomes more readable.
--
Stefano
Powered by blists - more mailing lists