Subject: Re: [PATCH v3] net: sched: tapr: prevent cycle_time == 0 in parse_taprio_schedule

From: Du Cheng <[email-masked]>
Date: Sat, 17 Apr 2021 07:31:45 +0800

Le Fri, Apr 16, 2021 at 10:14:52AM -0700, Cong Wang a écrit :
> On Thu, Apr 15, 2021 at 4:17 PM Du Cheng <[email-masked]> wrote:
> > diff --git a/net/sched/sch_taprio.c b/net/sched/sch_taprio.c
> > index 8287894541e3..abd6b176383c 100644
> > --- a/net/sched/sch_taprio.c
> > +++ b/net/sched/sch_taprio.c
> > @@ -901,6 +901,10 @@ static int parse_taprio_schedule(struct taprio_sched *q, struct nlattr **tb,
> >
> >                 list_for_each_entry(entry, &new->entries, list)
> >                         cycle = ktime_add_ns(cycle, entry->interval);
> > +
> > +               if (!cycle)
> > +                       return -EINVAL;
> 
> Just a nit: please add an extack to explain why we return EINVAL here.
> 
> Thanks.

Hi Cong,

Thanks!

I added extack and submitted v4. Please help me review.

Regards,
Du Cheng