All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH bpf] samples/bpf: Fix the error return code of xdp_redirect's main()
@ 2021-06-16  4:25 Wang Hai
  2021-06-18 18:20 ` patchwork-bot+netdevbpf
  2021-07-02 10:29 ` Jesper Dangaard Brouer
  0 siblings, 2 replies; 4+ messages in thread
From: Wang Hai @ 2021-06-16  4:25 UTC (permalink / raw)
  To: davem, kuba, ast, daniel, hawk, john.fastabend, andrii, kafai,
	songliubraving, yhs, kpsingh
  Cc: bpf, netdev, linux-kernel

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>
---
 samples/bpf/xdp_redirect_user.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/samples/bpf/xdp_redirect_user.c b/samples/bpf/xdp_redirect_user.c
index 41d705c3a1f7..c903f1ccc15e 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;
 }
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-07-05  7:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-16  4:25 [PATCH bpf] samples/bpf: Fix the error return code of xdp_redirect's main() Wang Hai
2021-06-18 18:20 ` patchwork-bot+netdevbpf
2021-07-02 10:29 ` Jesper Dangaard Brouer
2021-07-05  7:45   ` wanghai (M)

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.