On Thu, Apr 30, 2020 at 6:02 PM Cong Wang <xiyou.wangc...@gmail.com> wrote:
> diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
> index 55bd1429678f..80e93c96d2b2 100644
> --- a/net/sched/cls_api.c
> +++ b/net/sched/cls_api.c
> @@ -2612,12 +2612,10 @@ static int tc_dump_tfilter(struct sk_buff *skb, 
> struct netlink_callback *cb)
>                         return skb->len;
>
>                 parent = tcm->tcm_parent;
> -               if (!parent) {
> +               if (!parent)
>                         q = dev->qdisc;
> -                       parent = q->handle;
> -               } else {
> +               else
>                         q = qdisc_lookup(dev, TC_H_MAJ(tcm->tcm_parent));
> -               }
>                 if (!q)
>                         goto out;
>                 cops = q->ops->cl_ops;
> @@ -2633,6 +2631,7 @@ static int tc_dump_tfilter(struct sk_buff *skb, struct 
> netlink_callback *cb)
>                 block = cops->tcf_block(q, cl, NULL);
>                 if (!block)
>                         goto out;
> +               parent = block->q->handle;

Hmm, block->q could be NULL, I think I should just use q->handle
here.

Reply via email to