summaryrefslogtreecommitdiff
path: root/samples
diff options
context:
space:
mode:
authorWang Hai <wanghai38@huawei.com>2021-06-16 12:25:34 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-07-14 17:07:08 +0200
commita00c9faf7efa106a69a67408dd83dbc962887351 (patch)
tree007c22ed14a4b8c6eef90fd06ec2ac77972a4d4a /samples
parent9abfeb4e2c5fd54497d9f97d1c87ef78db51d1e7 (diff)
samples/bpf: Fix the error return code of xdp_redirect's main()
[ Upstream commit 7c6090ee2a7b3315410cfc83a94c3eb057407b25 ] Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. If bpf_map_update_elem() failed, main() should return a negative error. Fixes: 832622e6bd18 ("xdp: sample program for new bpf_redirect helper") Signed-off-by: Wang Hai <wanghai38@huawei.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/20210616042534.315097-1-wanghai38@huawei.com Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'samples')
-rw-r--r--samples/bpf/xdp_redirect_user.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/samples/bpf/xdp_redirect_user.c b/samples/bpf/xdp_redirect_user.c
index eb876629109a..93854e135134 100644
--- a/samples/bpf/xdp_redirect_user.c
+++ b/samples/bpf/xdp_redirect_user.c
@@ -213,5 +213,5 @@ int main(int argc, char **argv)
poll_stats(2, ifindex_out);
out:
- return 0;
+ return ret;
}