diff options
| author | Mark Brown <broonie@kernel.org> | 2018-01-25 18:16:26 +0000 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2018-01-25 18:16:26 +0000 |
| commit | 0b5eca67bd2d0e6f6d0ccdc316aced0cc4bf2e9f (patch) | |
| tree | b6597ffe774a67ab5b8eebd57c9a723732d3a39c /kernel/bpf/arraymap.c | |
| parent | 3bb0f7c31b1aedd0f85c675297031281799145d7 (diff) | |
| parent | 93a00c467fe998bf5716cbc9cabc127046054782 (diff) | |
| download | linux-0b5eca67bd2d0e6f6d0ccdc316aced0cc4bf2e9f.tar.gz linux-0b5eca67bd2d0e6f6d0ccdc316aced0cc4bf2e9f.tar.bz2 linux-0b5eca67bd2d0e6f6d0ccdc316aced0cc4bf2e9f.zip | |
Merge branches 'topic/twl4030' and 'topic/twl6040' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-twl-breakage
Diffstat (limited to 'kernel/bpf/arraymap.c')
| -rw-r--r-- | kernel/bpf/arraymap.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/kernel/bpf/arraymap.c b/kernel/bpf/arraymap.c index e2636737b69b..7c25426d3cf5 100644 --- a/kernel/bpf/arraymap.c +++ b/kernel/bpf/arraymap.c @@ -19,6 +19,9 @@ #include "map_in_map.h" +#define ARRAY_CREATE_FLAG_MASK \ + (BPF_F_NUMA_NODE | BPF_F_RDONLY | BPF_F_WRONLY) + static void bpf_array_free_percpu(struct bpf_array *array) { int i; @@ -56,7 +59,8 @@ static struct bpf_map *array_map_alloc(union bpf_attr *attr) /* check sanity of attributes */ if (attr->max_entries == 0 || attr->key_size != 4 || - attr->value_size == 0 || attr->map_flags & ~BPF_F_NUMA_NODE || + attr->value_size == 0 || + attr->map_flags & ~ARRAY_CREATE_FLAG_MASK || (percpu && numa_node != NUMA_NO_NODE)) return ERR_PTR(-EINVAL); @@ -492,7 +496,7 @@ static void *perf_event_fd_array_get_ptr(struct bpf_map *map, ee = ERR_PTR(-EOPNOTSUPP); event = perf_file->private_data; - if (perf_event_read_local(event, &value) == -EOPNOTSUPP) + if (perf_event_read_local(event, &value, NULL, NULL) == -EOPNOTSUPP) goto err_out; ee = bpf_event_entry_gen(perf_file, map_file); |
