On Mon, 2016-04-04 at 00:13 -0600, Jan Beulich wrote: > > > > On 01.04.16 at 19:01, wrote: > > Ok, I'll do: > > > >     sd->sched_priv = SCHED_OP(&ops, alloc_pdata, cpu); > >     if ( IS_ERR(sd->sched_priv) ) > >     { > >         int err = PTR_ERR(sd->sched_priv); > > > >         sd->sched_priv = NULL; > >         return err; > >     } > > > > Is this ok? > Depends: Can ->sched_priv be looked at by another CPU between > the first and second assignments? If yes, you need to use an > intermediary local variable. > Mmm... good point. I don't see this happening, but using a local variable is more "defensive programming oriented", so I'm going for it. Regards, Dario -- <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)