treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / tools / testing / selftests / bpf / progs / fexit_bpf2bpf_simple.c
blob92f3fa47cf4016781b0ad1c03a4203719e078440
1 // SPDX-License-Identifier: GPL-2.0
2 /* Copyright (c) 2019 Facebook */
3 #include <linux/bpf.h>
4 #include <bpf/bpf_helpers.h>
5 #include "bpf_trace_helpers.h"
7 struct sk_buff {
8 unsigned int len;
9 };
11 __u64 test_result = 0;
13 SEC("fexit/test_pkt_md_access")
14 int BPF_PROG(test_main2, struct sk_buff *skb, int ret)
16 int len;
18 __builtin_preserve_access_index(({
19 len = skb->len;
20 }));
21 if (len != 74 || ret != 0)
22 return 0;
24 test_result = 1;
25 return 0;
27 char _license[] SEC("license") = "GPL";