aboutsummaryrefslogtreecommitdiffstats
path: root/samples
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-12-11 08:50:05 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-12-11 08:50:05 +0100
commit73cf7e111ed69d8e1b59a3ae41b14bc77215e9ee (patch)
tree02cd3308d328bce9cf97bf2c1c9d5e932103ebfe /samples
parentdriver core: Remove redundant license text (diff)
parentLinux 4.15-rc3 (diff)
downloadlinux-dev-73cf7e111ed69d8e1b59a3ae41b14bc77215e9ee.tar.xz
linux-dev-73cf7e111ed69d8e1b59a3ae41b14bc77215e9ee.zip
Merge 4.15-rc3 into driver-core-next
We want the fixes and changes in here for testing. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'samples')
-rw-r--r--samples/bpf/bpf_load.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/samples/bpf/bpf_load.c b/samples/bpf/bpf_load.c
index 522ca9252d6c..242631aa4ea2 100644
--- a/samples/bpf/bpf_load.c
+++ b/samples/bpf/bpf_load.c
@@ -193,8 +193,18 @@ static int load_and_attach(const char *event, struct bpf_insn *prog, int size)
return -1;
}
event_fd[prog_cnt - 1] = efd;
- ioctl(efd, PERF_EVENT_IOC_ENABLE, 0);
- ioctl(efd, PERF_EVENT_IOC_SET_BPF, fd);
+ err = ioctl(efd, PERF_EVENT_IOC_ENABLE, 0);
+ if (err < 0) {
+ printf("ioctl PERF_EVENT_IOC_ENABLE failed err %s\n",
+ strerror(errno));
+ return -1;
+ }
+ err = ioctl(efd, PERF_EVENT_IOC_SET_BPF, fd);
+ if (err < 0) {
+ printf("ioctl PERF_EVENT_IOC_SET_BPF failed err %s\n",
+ strerror(errno));
+ return -1;
+ }
return 0;
}