lkml.org 
[lkml]   [2020]   [Nov]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [V2] trace: Fix passing zero to PTR_ERR()
From
Date


On 11/6/20 10:34 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>

For clarity, the subject probably should be
bpf: Fix passing zero to PTR_ERR()
to indicate this is a bpf related fix. The tag should
be something like
[PATCH bpf v2] or [PATCH v2 bpf]
depending on your preference, to indicate this is for bpf tree.

If another version is sent, the above "v2" should change to "v3".

> ---
> 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;
>

\
 
 \ /
  Last update: 2020-11-07 08:38    [W:2.801 / U:0.316 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site