Skip to content

Commit

Permalink
af-xdp: suppress cppcheck false positive
Browse files Browse the repository at this point in the history
As the cppcheck test suite does as well:
https://github.com/danmar/cppcheck/blob/main/test/cfg/posix.c#L311

Requires cppcheck --inline-suppr option to be used.
  • Loading branch information
victorjulien committed Feb 22, 2024
1 parent eb1d0c2 commit 69f0e85
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/source-af-xdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,7 @@ static inline ssize_t WakeupSocket(void *data)

/* Assuming kernel >= 5.11 in use if xdp_busy_poll is enabled */
if (ptv->xsk.enable_busy_poll || xsk_ring_prod__needs_wakeup(&ptv->umem.fq)) {
// cppcheck-suppress nullPointer
res = recvfrom(xsk_socket__fd(ptv->xsk.xsk), NULL, 0, MSG_DONTWAIT, NULL, NULL);
}

Expand Down

0 comments on commit 69f0e85

Please sign in to comment.