lkml.org 
[lkml]   [2018]   [Apr]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] bpf: btf: remove a couple conditions
On Fri, Apr 27, 2018 at 10:20:25AM -0700, Martin KaFai Lau wrote:
> On Fri, Apr 27, 2018 at 05:04:59PM +0300, Dan Carpenter wrote:
> > We know "err" is zero so we can remove these and pull the code in one
> > indent level.
> >
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> Thanks for the simplification!
>
> Acked-by: Martin KaFai Lau <kafai@fb.com>
btw, it should be for bpf-next. Please tag the subject with bpf-next when
you respin. Thanks!

>
> > ---
> > This applies to the BPF tree (linux-next)
> >
> > diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c
> > index e631b6fd60d3..7cb0905f37c2 100644
> > --- a/kernel/bpf/btf.c
> > +++ b/kernel/bpf/btf.c
> > @@ -1973,16 +1973,14 @@ static struct btf *btf_parse(void __user *btf_data, u32 btf_data_size,
> > if (err)
> > goto errout;
> >
> > - if (!err && log->level && bpf_verifier_log_full(log)) {
> > + if (log->level && bpf_verifier_log_full(log)) {
> > err = -ENOSPC;
> > goto errout;
> > }
> >
> > - if (!err) {
> > - btf_verifier_env_free(env);
> > - btf_get(btf);
> > - return btf;
> > - }
> > + btf_verifier_env_free(env);
> > + btf_get(btf);
> > + return btf;
> >
> > errout:
> > btf_verifier_env_free(env);

\
 
 \ /
  Last update: 2018-04-27 19:57    [W:0.082 / U:3.628 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site