[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 03/16] xen: sched: make implementing .alloc_pdata optional
>>> On 21.03.16 at 15:48, <JGross@xxxxxxxx> wrote: > On 18/03/16 20:04, Dario Faggioli wrote: >> --- a/xen/common/schedule.c >> +++ b/xen/common/schedule.c >> @@ -1491,9 +1491,9 @@ static int cpu_schedule_up(unsigned int cpu) >> if ( idle_vcpu[cpu] == NULL ) >> return -ENOMEM; >> >> - if ( (ops.alloc_pdata != NULL) && >> - ((sd->sched_priv = ops.alloc_pdata(&ops, cpu)) == NULL) ) >> - return -ENOMEM; >> + sd->sched_priv = SCHED_OP(&ops, alloc_pdata, cpu); >> + if ( IS_ERR(sd->sched_priv) ) >> + return PTR_ERR(sd->sched_priv); > > Calling xfree() with an IS_ERR() value might be a bad idea. > Either you need to set sd->sched_priv to NULL in error case or you > modify xfree() to return immediately not only in the NULL case, but > in the IS_ERR() case as well. The latter option is a no-go imo. Jan _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |