On Wed, 12 Sep 2018 at 16:17, Alexei Starovoitov <alexei.starovoi...@gmail.com> wrote: > > On Tue, Sep 11, 2018 at 05:36:35PM -0700, Joe Stringer wrote: > > ... > > + > > +/* release function corresponding to acquire_reference_state(). > > Idempotent. */ > > +static int __release_reference_state(struct bpf_func_state *state, int > > ptr_id) > > +{ > > + int i, last_idx; > > + > > + if (!ptr_id) > > + return 0; > > Is this defensive programming or this condition can actually happen? > As far as I can see all callers suppose to pass valid ptr_id into it. > > Acked-by: Alexei Starovoitov <a...@kernel.org> >
Looks like defensive programming to me. That said, if it's being defensive, why not return `-EFAULT`? I'll try this out locally.