From: Victor Julien Date: Wed, 22 Nov 2023 07:21:23 +0000 (+0100) Subject: ippair: fix minor coverity warning X-Git-Tag: suricata-8.0.0-beta1~2035 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=487b78fb3da85cf449a2e18dbf5f13488ca8b860;p=thirdparty%2Fsuricata.git ippair: fix minor coverity warning CID 1554232: Data race undermines locking (LOCK_EVASION) Ticket #6565. --- diff --git a/src/ippair.c b/src/ippair.c index 81362f63f4..b06f3d1644 100644 --- a/src/ippair.c +++ b/src/ippair.c @@ -338,14 +338,11 @@ void IPPairShutdown(void) */ void IPPairCleanup(void) { - IPPair *h; - uint32_t u; - if (ippair_hash != NULL) { - for (u = 0; u < ippair_config.hash_size; u++) { - h = ippair_hash[u].head; + for (uint32_t u = 0; u < ippair_config.hash_size; u++) { IPPairHashRow *hb = &ippair_hash[u]; HRLOCK_LOCK(hb); + IPPair *h = ippair_hash[u].head; while (h) { if ((SC_ATOMIC_GET(h->use_cnt) > 0)) { /* iprep is attached to ippair only clear local storage */