From: Jakub Sitnicki Date: Mon, 25 May 2020 12:29:28 +0000 (+0200) Subject: bpf: Fix returned error sign when link doesn't support updates X-Git-Tag: v5.8-rc1~165^2~6^2~29 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=fe537393b5795ecbe5746eec0e16124bc998a594;p=users%2Fjedix%2Flinux-maple.git bpf: Fix returned error sign when link doesn't support updates System calls encode returned errors as negative values. Fix a typo that breaks this convention for bpf(LINK_UPDATE) when bpf_link doesn't support update operation. Fixes: f9d041271cf4 ("bpf: Refactor bpf_link update handling") Signed-off-by: Jakub Sitnicki Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20200525122928.1164495-1-jakub@cloudflare.com Signed-off-by: Alexei Starovoitov --- diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c index aaa29fb6f363..d13b804ff045 100644 --- a/kernel/bpf/syscall.c +++ b/kernel/bpf/syscall.c @@ -3924,7 +3924,7 @@ static int link_update(union bpf_attr *attr) if (link->ops->update_prog) ret = link->ops->update_prog(link, new_prog, old_prog); else - ret = EINVAL; + ret = -EINVAL; out_put_progs: if (old_prog)