Skip to content

Commit

Permalink
libxdp: fix return to be -errno
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
brian90013 authored and tohojo committed Feb 21, 2025
1 parent b5b199f commit 289c8eb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/libxdp/xsk.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 289c8eb

Please sign in to comment.