]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
selftests/bpf: Fix bpf_prog_detach2 usage in test_lirc_mode2
authorRicardo B. Marlière <rbm@suse.com>
Thu, 28 Aug 2025 13:12:33 +0000 (10:12 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Nov 2025 20:34:03 +0000 (15:34 -0500)
[ Upstream commit 98857d111c53954aa038fcbc4cf48873e4240f7c ]

Commit e9fc3ce99b34 ("libbpf: Streamline error reporting for high-level
APIs") redefined the way that bpf_prog_detach2() returns. Therefore, adapt
the usage in test_lirc_mode2_user.c.

Signed-off-by: Ricardo B. Marlière <rbm@suse.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20250828-selftests-bpf-v1-1-c7811cd8b98c@suse.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/testing/selftests/bpf/test_lirc_mode2_user.c

index 4694422aa76c36faa4afa8832e56040547dc7547..88e4aeab21b7bc37665d6fd3959006c5a83a81c9 100644 (file)
@@ -74,7 +74,7 @@ int main(int argc, char **argv)
 
        /* Let's try detach it before it was ever attached */
        ret = bpf_prog_detach2(progfd, lircfd, BPF_LIRC_MODE2);
-       if (ret != -1 || errno != ENOENT) {
+       if (ret != -ENOENT) {
                printf("bpf_prog_detach2 not attached should fail: %m\n");
                return 1;
        }