Skip to content
Commit 55fbae05 authored by Martin KaFai Lau's avatar Martin KaFai Lau Committed by Alexei Starovoitov
Browse files

bpf: Check IS_ERR for the bpf_map_get() return value



This patch fixes a mistake in checking NULL instead of
checking IS_ERR for the bpf_map_get() return value.

It also fixes the return value in link_update_map() from -EINVAL
to PTR_ERR(*_map).

Reported-by: default avatar <syzbot+71ccc0fe37abb458406b@syzkaller.appspotmail.com>
Fixes: 68b04864 ("bpf: Create links for BPF struct_ops maps.")
Fixes: aef56f2e

 ("bpf: Update the struct_ops of a bpf_link.")
Signed-off-by: default avatarMartin KaFai Lau <martin.lau@kernel.org>
Acked-by: default avatarKui-Feng Lee <kuifeng@meta.com>
Acked-by: default avatarStanislav Fomichev <sdf@google.com>
Link: https://lore.kernel.org/r/20230324184241.1387437-1-martin.lau@linux.dev
Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
parent 226bc6ae
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment