Hi!
[ Upstream commit f3ef53174b23246fe9bc2bbc2542f3a3856fa1e2 ]
The opened file should be closed in show_sockopts(), otherwise resource leak will occur that this problem was discovered by reading code
Well, code exits when this fails, so there's really no leak.
Best regards, Pavel
+++ b/samples/bpf/test_cgrp2_sock.c @@ -174,8 +174,10 @@ static int show_sockopts(int family) return 1; }
- if (get_bind_to_device(sd, name, sizeof(name)) < 0)
- if (get_bind_to_device(sd, name, sizeof(name)) < 0) {
return 1;close(sd);
- }
mark = get_somark(sd); prio = get_priority(sd);