diff options
author | Prashant Bhole <bhole_prashant_q7@lab.ntt.co.jp> | 2018-10-08 21:04:50 -0400 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2018-10-10 00:52:20 -0400 |
commit | 3b4a63f674e94795c9b76a41b36364b8aec232e1 (patch) | |
tree | e5dae37fa352f22915e661a36af033b646bcdede /kernel/bpf/arraymap.c | |
parent | 509db2833e0ddac7faf6e7d2dd6e7f85c98fbee0 (diff) |
bpf: return EOPNOTSUPP when map lookup isn't supported
Return ERR_PTR(-EOPNOTSUPP) from map_lookup_elem() methods of below
map types:
- BPF_MAP_TYPE_PROG_ARRAY
- BPF_MAP_TYPE_STACK_TRACE
- BPF_MAP_TYPE_XSKMAP
- BPF_MAP_TYPE_SOCKMAP/BPF_MAP_TYPE_SOCKHASH
Signed-off-by: Prashant Bhole <bhole_prashant_q7@lab.ntt.co.jp>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'kernel/bpf/arraymap.c')
-rw-r--r-- | kernel/bpf/arraymap.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/bpf/arraymap.c b/kernel/bpf/arraymap.c index dded84cbe814..24583da9ffd1 100644 --- a/kernel/bpf/arraymap.c +++ b/kernel/bpf/arraymap.c | |||
@@ -449,7 +449,7 @@ static void fd_array_map_free(struct bpf_map *map) | |||
449 | 449 | ||
450 | static void *fd_array_map_lookup_elem(struct bpf_map *map, void *key) | 450 | static void *fd_array_map_lookup_elem(struct bpf_map *map, void *key) |
451 | { | 451 | { |
452 | return NULL; | 452 | return ERR_PTR(-EOPNOTSUPP); |
453 | } | 453 | } |
454 | 454 | ||
455 | /* only called from syscall */ | 455 | /* only called from syscall */ |