bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrii Nakryiko <andrii.nakryiko@gmail.com>
To: "Daniel T. Lee" <danieltimlee@gmail.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>,
	Alexei Starovoitov <ast@kernel.org>, Yonghong Song <yhs@fb.com>,
	Martin KaFai Lau <kafai@fb.com>, Andrii Nakryiko <andriin@fb.com>,
	Networking <netdev@vger.kernel.org>, bpf <bpf@vger.kernel.org>
Subject: Re: [PATCH 2/3] samples: bpf: cleanup pointer error check with libbpf
Date: Fri, 26 Jun 2020 13:24:54 -0700	[thread overview]
Message-ID: <CAEf4BzbWboyWH1NzvDT8AHxUs4mEV9tBUOyksGgaJrN7QKJLXA@mail.gmail.com> (raw)
In-Reply-To: <20200626081720.5546-2-danieltimlee@gmail.com>

On Fri, Jun 26, 2020 at 1:18 AM Daniel T. Lee <danieltimlee@gmail.com> wrote:
>
> Libbpf has its own helper function to check for errors in the bpf
> data structure (pointer). And Some codes do not use this libbbpf
> helper function and check the pointer's error directly.
>
> This commit clean up the existing pointer error check logic with
> libbpf.
>
> Signed-off-by: Daniel T. Lee <danieltimlee@gmail.com>
> ---

This entire patch is wrong. bpf_object__find_program_by_name() returns
NULL if the program is not found, not an error code.

>  samples/bpf/sampleip_user.c    | 2 +-
>  samples/bpf/trace_event_user.c | 2 +-
>  samples/bpf/tracex1_user.c     | 2 +-
>  samples/bpf/tracex5_user.c     | 2 +-
>  samples/bpf/tracex7_user.c     | 2 +-
>  5 files changed, 5 insertions(+), 5 deletions(-)
>

[...]

  reply	other threads:[~2020-06-26 20:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-26  8:17 [PATCH 1/3] samples: bpf: fix bpf programs with kprobe/sys_connect event Daniel T. Lee
2020-06-26  8:17 ` [PATCH 2/3] samples: bpf: cleanup pointer error check with libbpf Daniel T. Lee
2020-06-26 20:24   ` Andrii Nakryiko [this message]
2020-06-26 21:28     ` Daniel T. Lee
2020-06-26  8:17 ` [PATCH 3/3] samples: bpf: refactor BPF map in map test " Daniel T. Lee
2020-06-26 20:30   ` Andrii Nakryiko
2020-06-26 22:14     ` Daniel T. Lee
2020-06-26 22:19       ` Andrii Nakryiko
2020-06-26 22:25         ` Daniel T. Lee
2020-06-26 20:31 ` [PATCH 1/3] samples: bpf: fix bpf programs with kprobe/sys_connect event Andrii Nakryiko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAEf4BzbWboyWH1NzvDT8AHxUs4mEV9tBUOyksGgaJrN7QKJLXA@mail.gmail.com \
    --to=andrii.nakryiko@gmail.com \
    --cc=andriin@fb.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=danieltimlee@gmail.com \
    --cc=kafai@fb.com \
    --cc=netdev@vger.kernel.org \
    --cc=yhs@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).