Skip to content

Commit 1ad610a

Browse files
committed
Check for QQ_EBPF in bpf_queue_open
Forgot to move the check when I split with bpf_queue_open1()
1 parent 2faf618 commit 1ad610a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

bpf_queue.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -348,9 +348,6 @@ bpf_queue_open1(struct quark_queue *qq, int use_fentry)
348348

349349
libbpf_set_print(libbpf_print_fn);
350350

351-
if ((qq->flags & QQ_EBPF) == 0)
352-
return (errno = ENOTSUP, -1);
353-
354351
if ((bqq = calloc(1, sizeof(*bqq))) == NULL)
355352
return (-1);
356353

@@ -510,6 +507,9 @@ bpf_queue_open1(struct quark_queue *qq, int use_fentry)
510507
int
511508
bpf_queue_open(struct quark_queue *qq)
512509
{
510+
if ((qq->flags & QQ_EBPF) == 0)
511+
return (errno = ENOTSUP, -1);
512+
513513
if (bpf_queue_open1(qq, 1) == -1) {
514514
qwarn("bpf_queue_open failed with fentry, trying kprobe");
515515
return bpf_queue_open1(qq, 0);

0 commit comments

Comments
 (0)