Message ID | 1604735144-686-1-git-send-email-wangqing@vivo.com |
---|---|
State | Not Applicable |
Delegated to: | BPF Maintainers |
Headers | show |
Series | [v3,bpf] trace: bpf: Fix passing zero to PTR_ERR() | expand |
Context | Check | Description |
---|---|---|
jkicinski/cover_letter | success | Link |
jkicinski/fixes_present | fail | Series targets non-next tree, but doesn't contain any Fixes tags |
jkicinski/patch_count | success | Link |
jkicinski/tree_selection | success | Clearly marked for bpf |
jkicinski/subject_prefix | success | Link |
jkicinski/source_inline | success | Was 0 now: 0 |
jkicinski/verify_signedoff | success | Link |
jkicinski/module_param | success | Was 0 now: 0 |
jkicinski/build_32bit | fail | Errors and warnings before: 37 this patch: 37 |
jkicinski/kdoc | success | Errors and warnings before: 0 this patch: 0 |
jkicinski/verify_fixes | success | Link |
jkicinski/checkpatch | fail | Link |
jkicinski/build_allmodconfig_warn | success | Errors and warnings before: 33 this patch: 33 |
jkicinski/header_inline | success | Link |
jkicinski/stable | success | Stable not CCed |
On 11/6/20 11:45 PM, Wang Qing wrote: > There is a bug when passing zero to PTR_ERR() and return. > Fix smatch err. > > Signed-off-by: Wang Qing <wangqing@vivo.com> Acked-by: Yonghong Song <yhs@fb.com>
Wang Qing wrote: > There is a bug when passing zero to PTR_ERR() and return. > Fix smatch err. > > Signed-off-by: Wang Qing <wangqing@vivo.com> > --- > kernel/trace/bpf_trace.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c > index 4517c8b..5113fd4 > --- a/kernel/trace/bpf_trace.c > +++ b/kernel/trace/bpf_trace.c > @@ -1198,7 +1198,7 @@ static int bpf_btf_printf_prepare(struct btf_ptr *ptr, u32 btf_ptr_size, > *btf = bpf_get_btf_vmlinux(); > > if (IS_ERR_OR_NULL(*btf)) > - return PTR_ERR(*btf); > + return IS_ERR(*btf) ? PTR_ERR(*btf) : -EINVAL; > > if (ptr->type_id > 0) > *btf_id = ptr->type_id; > -- > 2.7.4 > Acked-by: John Fastabend <john.fastabend@gmail.com>
diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c index 4517c8b..5113fd4 --- a/kernel/trace/bpf_trace.c +++ b/kernel/trace/bpf_trace.c @@ -1198,7 +1198,7 @@ static int bpf_btf_printf_prepare(struct btf_ptr *ptr, u32 btf_ptr_size, *btf = bpf_get_btf_vmlinux(); if (IS_ERR_OR_NULL(*btf)) - return PTR_ERR(*btf); + return IS_ERR(*btf) ? PTR_ERR(*btf) : -EINVAL; if (ptr->type_id > 0) *btf_id = ptr->type_id;
There is a bug when passing zero to PTR_ERR() and return. Fix smatch err. Signed-off-by: Wang Qing <wangqing@vivo.com> --- kernel/trace/bpf_trace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)