From 487b78fb3da85cf449a2e18dbf5f13488ca8b860 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Wed, 22 Nov 2023 08:21:23 +0100 Subject: [PATCH] ippair: fix minor coverity warning CID 1554232: Data race undermines locking (LOCK_EVASION) Ticket #6565. --- src/ippair.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) 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 */