Coverity flags that 'h' variable is used before
it's checked for NULL. This patch fixes this issue.
Coverity issue: 363625
Fixes:
769b2de7fb52 ("hash: implement RCU resources reclamation")
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Reviewed-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Acked-by: Yipeng Wang <yipeng1.wang@intel.com>
struct rte_rcu_qsbr_dq_parameters params = {0};
char rcu_dq_name[RTE_RCU_QSBR_DQ_NAMESIZE];
struct rte_hash_rcu_config *hash_rcu_cfg = NULL;
- const uint32_t total_entries = h->use_local_cache ?
- h->entries + (RTE_MAX_LCORE - 1) * (LCORE_CACHE_SIZE - 1) + 1
- : h->entries + 1;
if (h == NULL || cfg == NULL || cfg->v == NULL) {
rte_errno = EINVAL;
return 1;
}
+ const uint32_t total_entries = h->use_local_cache ?
+ h->entries + (RTE_MAX_LCORE - 1) * (LCORE_CACHE_SIZE - 1) + 1
+ : h->entries + 1;
+
if (h->hash_rcu_cfg) {
rte_errno = EEXIST;
return 1;