From: Stefano Brivio <sbrivio@redhat.com>
To: Davide Caratti <dcaratti@redhat.com>
Cc: Cong Wang <xiyou.wangcong@gmail.com>,
Jamal Hadi Salim <jhs@mojatatu.com>,
Jiri Pirko <jiri@resnulli.us>,
"David S. Miller" <davem@davemloft.net>,
netdev@vger.kernel.org, Paolo Abeni <pabeni@redhat.com>,
Li Shuang <shuali@redhat.com>
Subject: Re: [PATCH net] net/sched: pfifo_fast: fix wrong dereference when qdisc is reset
Date: Tue, 27 Aug 2019 11:50:31 +0200 [thread overview]
Message-ID: <20190827115031.43fcbac5@redhat.com> (raw)
In-Reply-To: <0598164c6e32684e57c7656f0b8aca0813c51f42.1566861256.git.dcaratti@redhat.com>
On Tue, 27 Aug 2019 01:15:16 +0200
Davide Caratti <dcaratti@redhat.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
next prev parent reply other threads:[~2019-08-27 9:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-26 23:15 [PATCH net] net/sched: pfifo_fast: fix wrong dereference when qdisc is reset Davide Caratti
2019-08-27 9:50 ` Stefano Brivio [this message]
2019-08-27 10:15 ` Davide Caratti
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190827115031.43fcbac5@redhat.com \
--to=sbrivio@redhat.com \
--cc=davem@davemloft.net \
--cc=dcaratti@redhat.com \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shuali@redhat.com \
--cc=xiyou.wangcong@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).