From: Victor Julien Date: Tue, 20 Feb 2024 15:07:37 +0000 (+0100) Subject: af-xdp: suppress cppcheck false positive X-Git-Tag: suricata-8.0.0-beta1~1718 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F10486%2Fhead;p=thirdparty%2Fsuricata.git af-xdp: suppress cppcheck false positive 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. --- diff --git a/src/source-af-xdp.c b/src/source-af-xdp.c index 17fa0efeec..b69fd497dc 100644 --- a/src/source-af-xdp.c +++ b/src/source-af-xdp.c @@ -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); }