]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
af-xdp: suppress cppcheck false positive 10486/head
authorVictor Julien <vjulien@oisf.net>
Tue, 20 Feb 2024 15:07:37 +0000 (16:07 +0100)
committerVictor Julien <victor@inliniac.net>
Thu, 22 Feb 2024 09:02:48 +0000 (10:02 +0100)
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.

src/source-af-xdp.c

index 17fa0efeec4f7fc018f5a7854b877f4c4be31e6b..b69fd497dc8c99d84f13b89618345e5b15d0b36d 100644 (file)
@@ -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);
     }