From 289c8eb44689f437a0f6df329cedc71a76a15f20 Mon Sep 17 00:00:00 2001 From: Brian Poole Date: Thu, 20 Feb 2025 12:11:22 -0500 Subject: [PATCH] libxdp: fix return to be -errno The expected behavior is that functions return -errno on error. Correct two locations where errno was returned directly as a positive integer. This affects xsk_umem__create_with_fd() and xsk_socket__create_shared(). Signed-off-by: Brian Poole --- lib/libxdp/xsk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libxdp/xsk.c b/lib/libxdp/xsk.c index f31f6157..566ceda9 100644 --- a/lib/libxdp/xsk.c +++ b/lib/libxdp/xsk.c @@ -386,7 +386,7 @@ int xsk_umem__create_with_fd(struct xsk_umem **umem_ptr, int fd, } umem = xsk_umem__create_opts(umem_area, fill, comp, &opts); if (!umem) - return errno; + return -errno; *umem_ptr = umem; return 0; @@ -1283,7 +1283,7 @@ int xsk_socket__create_shared(struct xsk_socket **xsk_ptr, } xsk = xsk_socket__create_opts(ifname, queue_id, umem, &opts); if (!xsk) - return errno; + return -errno; *xsk_ptr = xsk; return 0;