Commit d98363b5 authored by Hariprasad Kelam's avatar Hariprasad Kelam Committed by Daniel Borkmann

libbpf: fix warning that PTR_ERR_OR_ZERO can be used

Fix below warning reported by coccicheck:

/tools/lib/bpf/libbpf.c:3461:1-3: WARNING: PTR_ERR_OR_ZERO can be used
Signed-off-by: default avatarHariprasad Kelam <hariprasad.kelam@gmail.com>
Acked-by: default avatarYonghong Song <yhs@fb.com>
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
parent 92bd6820
...@@ -3460,9 +3460,7 @@ bpf_object__find_map_by_offset(struct bpf_object *obj, size_t offset) ...@@ -3460,9 +3460,7 @@ bpf_object__find_map_by_offset(struct bpf_object *obj, size_t offset)
long libbpf_get_error(const void *ptr) long libbpf_get_error(const void *ptr)
{ {
if (IS_ERR(ptr)) return PTR_ERR_OR_ZERO(ptr);
return PTR_ERR(ptr);
return 0;
} }
int bpf_prog_load(const char *file, enum bpf_prog_type type, int bpf_prog_load(const char *file, enum bpf_prog_type type,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment