diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c index 0fd80ac81f705..72e943b3bd656 100644 --- a/kernel/bpf/syscall.c +++ b/kernel/bpf/syscall.c @@ -2629,7 +2629,7 @@ static int bpf_raw_tp_link_fill_link_info(const struct bpf_link *link, u32 ulen = info->raw_tracepoint.tp_name_len; size_t tp_len = strlen(tp_name); - if (ulen && !ubuf) + if (!ulen ^ !ubuf) return -EINVAL; info->raw_tracepoint.tp_name_len = tp_len + 1;