diff options
author | Prashant Bhole <bhole_prashant_q7@lab.ntt.co.jp> | 2018-10-09 03:04:50 +0200 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2018-10-10 06:52:20 +0200 |
commit | 3b4a63f674e94795c9b76a41b36364b8aec232e1 (patch) | |
tree | e5dae37fa352f22915e661a36af033b646bcdede /kernel/bpf/stackmap.c | |
parent | bpf: error handling when map_lookup_elem isn't supported (diff) | |
download | linux-3b4a63f674e94795c9b76a41b36364b8aec232e1.tar.xz linux-3b4a63f674e94795c9b76a41b36364b8aec232e1.zip |
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/stackmap.c')
-rw-r--r-- | kernel/bpf/stackmap.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/bpf/stackmap.c b/kernel/bpf/stackmap.c index 8061a439ef18..b2ade10f7ec3 100644 --- a/kernel/bpf/stackmap.c +++ b/kernel/bpf/stackmap.c @@ -505,7 +505,7 @@ const struct bpf_func_proto bpf_get_stack_proto = { /* Called from eBPF program */ static void *stack_map_lookup_elem(struct bpf_map *map, void *key) { - return NULL; + return ERR_PTR(-EOPNOTSUPP); } /* Called from syscall */ |