UPSTREAM: 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")
Change-Id: Icdad951e8d5b36f087a36da8c7f5c658795f0dce
Signed-off-by: Jakub Sitnicki <jakub@cloudflare.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20200525122928.1164495-1-jakub@cloudflare.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
This commit is contained in:
Jakub Sitnicki 2020-05-25 14:29:28 +02:00 • committed by basamaryan
commit d55abb0fad
No known key found for this signature in database
GPG key ID: 210D5384FB2A5885

View file

@ -3931,7 +3931,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)