mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] trace: Fix passing zero to 'PTR_ERR' warning
@ 2020-11-06  8:47 Wang Qing
  2020-11-06 20:41 ` Andrii Nakryiko
  0 siblings, 1 reply; 2+ messages in thread
From: Wang Qing @ 2020-11-06  8:47 UTC (permalink / raw)
  To: Steven Rostedt, Ingo Molnar, Alexei Starovoitov, Daniel Borkmann,
	Martin KaFai Lau, Song Liu, Yonghong Song, Andrii Nakryiko,
	John Fastabend, KP Singh, netdev, bpf, linux-kernel
  Cc: Wang Qing

Fix smatch warning.

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..2cb9c45
--- 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 PTR_ERR_OR_ZERO(*btf);
 
 	if (ptr->type_id > 0)
 		*btf_id = ptr->type_id;
-- 
2.7.4


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-11-06 20:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-06  8:47 [PATCH] trace: Fix passing zero to 'PTR_ERR' warning Wang Qing
2020-11-06 20:41 ` Andrii Nakryiko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®