diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c
index 25e4bdb7a6..2a9a6c3bf8 100644
--- a/drivers/net/mlx5/linux/mlx5_os.c
+++ b/drivers/net/mlx5/linux/mlx5_os.c
@@ -274,36 +274,44 @@ mlx5_alloc_shared_dr(struct mlx5_priv *priv)
 #ifdef HAVE_IBV_FLOW_DV_SUPPORT
 	/* Init port id action list. */
 	snprintf(s, sizeof(s), "%s_port_id_action_list", sh->ibdev_name);
-	mlx5_list_create(&sh->port_id_action_list, s, sh,
-			 flow_dv_port_id_create_cb,
-			 flow_dv_port_id_match_cb,
-			 flow_dv_port_id_remove_cb,
-			 flow_dv_port_id_clone_cb,
-			 flow_dv_port_id_clone_free_cb);
+	sh->port_id_action_list = mlx5_list_create(s, sh,
+						   flow_dv_port_id_create_cb,
+						   flow_dv_port_id_match_cb,
+						   flow_dv_port_id_remove_cb,
+						   flow_dv_port_id_clone_cb,
+						 flow_dv_port_id_clone_free_cb);
+	if (!sh->port_id_action_list)
+		goto error;
 	/* Init push vlan action list. */
 	snprintf(s, sizeof(s), "%s_push_vlan_action_list", sh->ibdev_name);
-	mlx5_list_create(&sh->push_vlan_action_list, s, sh,
-			 flow_dv_push_vlan_create_cb,
-			 flow_dv_push_vlan_match_cb,
-			 flow_dv_push_vlan_remove_cb,
-			 flow_dv_push_vlan_clone_cb,
-			 flow_dv_push_vlan_clone_free_cb);
+	sh->push_vlan_action_list = mlx5_list_create(s, sh,
+						    flow_dv_push_vlan_create_cb,
+						    flow_dv_push_vlan_match_cb,
+						    flow_dv_push_vlan_remove_cb,
+						    flow_dv_push_vlan_clone_cb,
+					       flow_dv_push_vlan_clone_free_cb);
+	if (!sh->push_vlan_action_list)
+		goto error;
 	/* Init sample action list. */
 	snprintf(s, sizeof(s), "%s_sample_action_list", sh->ibdev_name);
-	mlx5_list_create(&sh->sample_action_list, s, sh,
-			 flow_dv_sample_create_cb,
-			 flow_dv_sample_match_cb,
-			 flow_dv_sample_remove_cb,
-			 flow_dv_sample_clone_cb,
-			 flow_dv_sample_clone_free_cb);
+	sh->sample_action_list = mlx5_list_create(s, sh,
+						  flow_dv_sample_create_cb,
+						  flow_dv_sample_match_cb,
+						  flow_dv_sample_remove_cb,
+						  flow_dv_sample_clone_cb,
+						  flow_dv_sample_clone_free_cb);
+	if (!sh->sample_action_list)
+		goto error;
 	/* Init dest array action list. */
 	snprintf(s, sizeof(s), "%s_dest_array_list", sh->ibdev_name);
-	mlx5_list_create(&sh->dest_array_list, s, sh,
-			 flow_dv_dest_array_create_cb,
-			 flow_dv_dest_array_match_cb,
-			 flow_dv_dest_array_remove_cb,
-			 flow_dv_dest_array_clone_cb,
-			 flow_dv_dest_array_clone_free_cb);
+	sh->dest_array_list = mlx5_list_create(s, sh,
+					       flow_dv_dest_array_create_cb,
+					       flow_dv_dest_array_match_cb,
+					       flow_dv_dest_array_remove_cb,
+					       flow_dv_dest_array_clone_cb,
+					      flow_dv_dest_array_clone_free_cb);
+	if (!sh->dest_array_list)
+		goto error;
 	/* Create tags hash list table. */
 	snprintf(s, sizeof(s), "%s_tags", sh->ibdev_name);
 	sh->tag_table = mlx5_hlist_create(s, MLX5_TAGS_HLIST_ARRAY_SIZE, 0,
@@ -456,6 +464,22 @@ mlx5_alloc_shared_dr(struct mlx5_priv *priv)
 		sh->tunnel_hub = NULL;
 	}
 	mlx5_free_table_hash_list(priv);
+	if (sh->port_id_action_list) {
+		mlx5_list_destroy(sh->port_id_action_list);
+		sh->port_id_action_list = NULL;
+	}
+	if (sh->push_vlan_action_list) {
+		mlx5_list_destroy(sh->push_vlan_action_list);
+		sh->push_vlan_action_list = NULL;
+	}
+	if (sh->sample_action_list) {
+		mlx5_list_destroy(sh->sample_action_list);
+		sh->sample_action_list = NULL;
+	}
+	if (sh->dest_array_list) {
+		mlx5_list_destroy(sh->dest_array_list);
+		sh->dest_array_list = NULL;
+	}
 	return err;
 }
 
@@ -517,9 +541,23 @@ mlx5_os_free_shared_dr(struct mlx5_priv *priv)
 		mlx5_release_tunnel_hub(sh, priv->dev_port);
 		sh->tunnel_hub = NULL;
 	}
-	mlx5_list_destroy(&sh->port_id_action_list);
-	mlx5_list_destroy(&sh->push_vlan_action_list);
 	mlx5_free_table_hash_list(priv);
+	if (sh->port_id_action_list) {
+		mlx5_list_destroy(sh->port_id_action_list);
+		sh->port_id_action_list = NULL;
+	}
+	if (sh->push_vlan_action_list) {
+		mlx5_list_destroy(sh->push_vlan_action_list);
+		sh->push_vlan_action_list = NULL;
+	}
+	if (sh->sample_action_list) {
+		mlx5_list_destroy(sh->sample_action_list);
+		sh->sample_action_list = NULL;
+	}
+	if (sh->dest_array_list) {
+		mlx5_list_destroy(sh->dest_array_list);
+		sh->dest_array_list = NULL;
+	}
 }
 
 /**
@@ -1721,11 +1759,13 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,
 			err = ENOTSUP;
 			goto error;
 	}
-	mlx5_list_create(&priv->hrxqs, "hrxq", eth_dev, mlx5_hrxq_create_cb,
-			 mlx5_hrxq_match_cb,
-			 mlx5_hrxq_remove_cb,
-			 mlx5_hrxq_clone_cb,
-			 mlx5_hrxq_clone_free_cb);
+	priv->hrxqs = mlx5_list_create("hrxq", eth_dev, mlx5_hrxq_create_cb,
+				       mlx5_hrxq_match_cb,
+				       mlx5_hrxq_remove_cb,
+				       mlx5_hrxq_clone_cb,
+				       mlx5_hrxq_clone_free_cb);
+	if (!priv->hrxqs)
+		goto error;
 	rte_rwlock_init(&priv->ind_tbls_lock);
 	/* Query availability of metadata reg_c's. */
 	err = mlx5_flow_discover_mreg_c(eth_dev);
@@ -1784,7 +1824,8 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,
 			mlx5_l3t_destroy(priv->mtr_profile_tbl);
 		if (own_domain_id)
 			claim_zero(rte_eth_switch_domain_free(priv->domain_id));
-		mlx5_list_destroy(&priv->hrxqs);
+		if (priv->hrxqs)
+			mlx5_list_destroy(priv->hrxqs);
 		mlx5_free(priv);
 		if (eth_dev != NULL)
 			eth_dev->data->dev_private = NULL;
diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index 5cd2cfb07c..d04b5d616f 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -1612,7 +1612,8 @@ mlx5_dev_close(struct rte_eth_dev *dev)
 	if (ret)
 		DRV_LOG(WARNING, "port %u some flows still remain",
 			dev->data->port_id);
-	mlx5_list_destroy(&priv->hrxqs);
+	if (priv->hrxqs)
+		mlx5_list_destroy(priv->hrxqs);
 	/*
 	 * Free the shared context in last turn, because the cleanup
 	 * routines above may use some shared fields, like
diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h
index 1141e12977..88b84d749a 100644
--- a/drivers/net/mlx5/mlx5.h
+++ b/drivers/net/mlx5/mlx5.h
@@ -1137,10 +1137,10 @@ struct mlx5_dev_ctx_shared {
 	struct mlx5_hlist *encaps_decaps; /* Encap/decap action hash list. */
 	struct mlx5_hlist *modify_cmds;
 	struct mlx5_hlist *tag_table;
-	struct mlx5_list port_id_action_list; /* Port ID action list. */
-	struct mlx5_list push_vlan_action_list; /* Push VLAN actions. */
-	struct mlx5_list sample_action_list; /* List of sample actions. */
-	struct mlx5_list dest_array_list;
+	struct mlx5_list *port_id_action_list; /* Port ID action list. */
+	struct mlx5_list *push_vlan_action_list; /* Push VLAN actions. */
+	struct mlx5_list *sample_action_list; /* List of sample actions. */
+	struct mlx5_list *dest_array_list;
 	/* List of destination array actions. */
 	struct mlx5_flow_counter_mng cmng; /* Counters management structure. */
 	void *default_miss_action; /* Default miss action. */
@@ -1382,7 +1382,7 @@ struct mlx5_priv {
 	struct mlx5_obj_ops obj_ops; /* HW objects operations. */
 	LIST_HEAD(rxq, mlx5_rxq_ctrl) rxqsctrl; /* DPDK Rx queues. */
 	LIST_HEAD(rxqobj, mlx5_rxq_obj) rxqsobj; /* Verbs/DevX Rx queues. */
-	struct mlx5_list hrxqs; /* Hash Rx queues. */
+	struct mlx5_list *hrxqs; /* Hash Rx queues. */
 	LIST_HEAD(txq, mlx5_txq_ctrl) txqsctrl; /* DPDK Tx queues. */
 	LIST_HEAD(txqobj, mlx5_txq_obj) txqsobj; /* Verbs/DevX Tx queues. */
 	/* Indirection tables. */
diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h
index 2016adc6ee..59a6f31d2e 100644
--- a/drivers/net/mlx5/mlx5_flow.h
+++ b/drivers/net/mlx5/mlx5_flow.h
@@ -591,7 +591,7 @@ struct mlx5_flow_tbl_data_entry {
 	/**< hash list entry, 64-bits key inside. */
 	struct mlx5_flow_tbl_resource tbl;
 	/**< flow table resource. */
-	struct mlx5_list matchers;
+	struct mlx5_list *matchers;
 	/**< matchers' header associated with the flow table. */
 	struct mlx5_flow_dv_jump_tbl_resource jump;
 	/**< jump resource, at most one for each table created. */
diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 2d0e82fab7..5a536e3dff 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -3889,7 +3889,7 @@ flow_dv_port_id_action_resource_register
 		.data = ref,
 	};
 
-	entry = mlx5_list_register(&priv->sh->port_id_action_list, &ctx);
+	entry = mlx5_list_register(priv->sh->port_id_action_list, &ctx);
 	if (!entry)
 		return -rte_errno;
 	resource = container_of(entry, typeof(*resource), entry);
@@ -4014,7 +4014,7 @@ flow_dv_push_vlan_action_resource_register
 		.data = ref,
 	};
 
-	entry = mlx5_list_register(&priv->sh->push_vlan_action_list, &ctx);
+	entry = mlx5_list_register(priv->sh->push_vlan_action_list, &ctx);
 	if (!entry)
 		return -rte_errno;
 	resource = container_of(entry, typeof(*resource), entry);
@@ -10054,12 +10054,22 @@ flow_dv_tbl_create_cb(struct mlx5_hlist *list, uint64_t key64, void *cb_ctx)
 	MKSTR(matcher_name, "%s_%s_%u_%u_matcher_list",
 	      key.is_fdb ? "FDB" : "NIC", key.is_egress ? "egress" : "ingress",
 	      key.level, key.id);
-	mlx5_list_create(&tbl_data->matchers, matcher_name, sh,
-			 flow_dv_matcher_create_cb,
-			 flow_dv_matcher_match_cb,
-			 flow_dv_matcher_remove_cb,
-			 flow_dv_matcher_clone_cb,
-			 flow_dv_matcher_clone_free_cb);
+	tbl_data->matchers = mlx5_list_create(matcher_name, sh,
+					      flow_dv_matcher_create_cb,
+					      flow_dv_matcher_match_cb,
+					      flow_dv_matcher_remove_cb,
+					      flow_dv_matcher_clone_cb,
+					      flow_dv_matcher_clone_free_cb);
+	if (!tbl_data->matchers) {
+		rte_flow_error_set(error, ENOMEM,
+				   RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
+				   NULL,
+				   "cannot create tbl matcher list");
+		mlx5_flow_os_destroy_flow_action(tbl_data->jump.action);
+		mlx5_flow_os_destroy_flow_tbl(tbl->obj);
+		mlx5_ipool_free(sh->ipool[MLX5_IPOOL_JUMP], idx);
+		return NULL;
+	}
 	return &tbl_data->entry;
 }
 
@@ -10187,7 +10197,7 @@ flow_dv_tbl_remove_cb(struct mlx5_hlist *list,
 			tbl_data->tunnel->tunnel_id : 0,
 			tbl_data->group_id);
 	}
-	mlx5_list_destroy(&tbl_data->matchers);
+	mlx5_list_destroy(tbl_data->matchers);
 	mlx5_ipool_free(sh->ipool[MLX5_IPOOL_JUMP], tbl_data->idx);
 }
 
@@ -10319,7 +10329,7 @@ flow_dv_matcher_register(struct rte_eth_dev *dev,
 		return -rte_errno;	/* No need to refill the error info */
 	tbl_data = container_of(tbl, struct mlx5_flow_tbl_data_entry, tbl);
 	ref->tbl = tbl;
-	entry = mlx5_list_register(&tbl_data->matchers, &ctx);
+	entry = mlx5_list_register(tbl_data->matchers, &ctx);
 	if (!entry) {
 		flow_dv_tbl_resource_release(MLX5_SH(dev), tbl);
 		return rte_flow_error_set(error, ENOMEM,
@@ -10916,7 +10926,7 @@ flow_dv_sample_resource_register(struct rte_eth_dev *dev,
 		.data = ref,
 	};
 
-	entry = mlx5_list_register(&priv->sh->sample_action_list, &ctx);
+	entry = mlx5_list_register(priv->sh->sample_action_list, &ctx);
 	if (!entry)
 		return -rte_errno;
 	resource = container_of(entry, typeof(*resource), entry);
@@ -11131,7 +11141,7 @@ flow_dv_dest_array_resource_register(struct rte_eth_dev *dev,
 		.data = ref,
 	};
 
-	entry = mlx5_list_register(&priv->sh->dest_array_list, &ctx);
+	entry = mlx5_list_register(priv->sh->dest_array_list, &ctx);
 	if (!entry)
 		return -rte_errno;
 	resource = container_of(entry, typeof(*resource), entry);
@@ -13610,7 +13620,7 @@ flow_dv_matcher_release(struct rte_eth_dev *dev,
 	int ret;
 
 	MLX5_ASSERT(matcher->matcher_object);
-	ret = mlx5_list_unregister(&tbl->matchers, &matcher->entry);
+	ret = mlx5_list_unregister(tbl->matchers, &matcher->entry);
 	flow_dv_tbl_resource_release(MLX5_SH(dev), &tbl->tbl);
 	return ret;
 }
@@ -13753,7 +13763,7 @@ flow_dv_port_id_action_resource_release(struct rte_eth_dev *dev,
 	if (!resource)
 		return 0;
 	MLX5_ASSERT(resource->action);
-	return mlx5_list_unregister(&priv->sh->port_id_action_list,
+	return mlx5_list_unregister(priv->sh->port_id_action_list,
 				    &resource->entry);
 }
 
@@ -13811,7 +13821,7 @@ flow_dv_push_vlan_action_resource_release(struct rte_eth_dev *dev,
 	if (!resource)
 		return 0;
 	MLX5_ASSERT(resource->action);
-	return mlx5_list_unregister(&priv->sh->push_vlan_action_list,
+	return mlx5_list_unregister(priv->sh->push_vlan_action_list,
 				    &resource->entry);
 }
 
@@ -13892,7 +13902,7 @@ flow_dv_sample_resource_release(struct rte_eth_dev *dev,
 	if (!resource)
 		return 0;
 	MLX5_ASSERT(resource->verbs_action);
-	return mlx5_list_unregister(&priv->sh->sample_action_list,
+	return mlx5_list_unregister(priv->sh->sample_action_list,
 				    &resource->entry);
 }
 
@@ -13940,7 +13950,7 @@ flow_dv_dest_array_resource_release(struct rte_eth_dev *dev,
 	if (!resource)
 		return 0;
 	MLX5_ASSERT(resource->action);
-	return mlx5_list_unregister(&priv->sh->dest_array_list,
+	return mlx5_list_unregister(priv->sh->dest_array_list,
 				    &resource->entry);
 }
 
@@ -14791,7 +14801,7 @@ __flow_dv_destroy_sub_policy_rules(struct rte_eth_dev *dev,
 			claim_zero(mlx5_flow_os_destroy_flow(color_rule->rule));
 			tbl = container_of(color_rule->matcher->tbl,
 					typeof(*tbl), tbl);
-			mlx5_list_unregister(&tbl->matchers,
+			mlx5_list_unregister(tbl->matchers,
 						&color_rule->matcher->entry);
 			TAILQ_REMOVE(&sub_policy->color_rules[i],
 					color_rule, next_port);
@@ -15584,7 +15594,7 @@ flow_dv_destroy_mtr_drop_tbls(struct rte_eth_dev *dev)
 		if (mtrmng->def_matcher[i]) {
 			tbl = container_of(mtrmng->def_matcher[i]->tbl,
 				struct mlx5_flow_tbl_data_entry, tbl);
-			mlx5_list_unregister(&tbl->matchers,
+			mlx5_list_unregister(tbl->matchers,
 					     &mtrmng->def_matcher[i]->entry);
 			mtrmng->def_matcher[i] = NULL;
 		}
@@ -15594,7 +15604,7 @@ flow_dv_destroy_mtr_drop_tbls(struct rte_eth_dev *dev)
 				container_of(mtrmng->drop_matcher[i][j]->tbl,
 					     struct mlx5_flow_tbl_data_entry,
 					     tbl);
-				mlx5_list_unregister(&tbl->matchers,
+				mlx5_list_unregister(tbl->matchers,
 					    &mtrmng->drop_matcher[i][j]->entry);
 				mtrmng->drop_matcher[i][j] = NULL;
 			}
@@ -15729,7 +15739,7 @@ __flow_dv_create_policy_matcher(struct rte_eth_dev *dev,
 	matcher.priority = priority;
 	matcher.crc = rte_raw_cksum((const void *)matcher.mask.buf,
 					matcher.mask.size);
-	entry = mlx5_list_register(&tbl_data->matchers, &ctx);
+	entry = mlx5_list_register(tbl_data->matchers, &ctx);
 	if (!entry) {
 		DRV_LOG(ERR, "Failed to register meter drop matcher.");
 		return -1;
@@ -15837,7 +15847,7 @@ __flow_dv_create_domain_policy_rules(struct rte_eth_dev *dev,
 			struct mlx5_flow_tbl_data_entry *tbl =
 				container_of(color_rule->matcher->tbl,
 						typeof(*tbl), tbl);
-			mlx5_list_unregister(&tbl->matchers,
+			mlx5_list_unregister(tbl->matchers,
 						&color_rule->matcher->entry);
 		}
 		mlx5_free(color_rule);
@@ -16235,7 +16245,7 @@ flow_dv_create_mtr_tbls(struct rte_eth_dev *dev,
 			matcher.crc = rte_raw_cksum
 					((const void *)matcher.mask.buf,
 					matcher.mask.size);
-			entry = mlx5_list_register(&tbl_data->matchers, &ctx);
+			entry = mlx5_list_register(tbl_data->matchers, &ctx);
 			if (!entry) {
 				DRV_LOG(ERR, "Failed to register meter "
 				"drop default matcher.");
@@ -16272,7 +16282,7 @@ flow_dv_create_mtr_tbls(struct rte_eth_dev *dev,
 			matcher.crc = rte_raw_cksum
 					((const void *)matcher.mask.buf,
 					matcher.mask.size);
-			entry = mlx5_list_register(&tbl_data->matchers, &ctx);
+			entry = mlx5_list_register(tbl_data->matchers, &ctx);
 			if (!entry) {
 				DRV_LOG(ERR,
 				"Failed to register meter drop matcher.");
@@ -16689,7 +16699,7 @@ flow_dv_meter_hierarchy_rule_create(struct rte_eth_dev *dev,
 			struct mlx5_flow_tbl_data_entry *tbl =
 				container_of(color_rule->matcher->tbl,
 						typeof(*tbl), tbl);
-			mlx5_list_unregister(&tbl->matchers,
+			mlx5_list_unregister(tbl->matchers,
 						&color_rule->matcher->entry);
 		}
 		mlx5_free(color_rule);
diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index f8769da8dc..aa9e973d10 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -2385,7 +2385,7 @@ uint32_t mlx5_hrxq_get(struct rte_eth_dev *dev,
 	if (rss_desc->shared_rss) {
 		hrxq = __mlx5_hrxq_create(dev, rss_desc);
 	} else {
-		entry = mlx5_list_register(&priv->hrxqs, &ctx);
+		entry = mlx5_list_register(priv->hrxqs, &ctx);
 		if (!entry)
 			return 0;
 		hrxq = container_of(entry, typeof(*hrxq), entry);
@@ -2415,7 +2415,7 @@ int mlx5_hrxq_release(struct rte_eth_dev *dev, uint32_t hrxq_idx)
 	if (!hrxq)
 		return 0;
 	if (!hrxq->standalone)
-		return mlx5_list_unregister(&priv->hrxqs, &hrxq->entry);
+		return mlx5_list_unregister(priv->hrxqs, &hrxq->entry);
 	__mlx5_hrxq_remove(dev, hrxq);
 	return 0;
 }
@@ -2503,7 +2503,7 @@ mlx5_hrxq_verify(struct rte_eth_dev *dev)
 {
 	struct mlx5_priv *priv = dev->data->dev_private;
 
-	return mlx5_list_get_entry_num(&priv->hrxqs);
+	return mlx5_list_get_entry_num(priv->hrxqs);
 }
 
 /**
diff --git a/drivers/net/mlx5/mlx5_utils.c b/drivers/net/mlx5/mlx5_utils.c
index daecf37575..0be778935f 100644
--- a/drivers/net/mlx5/mlx5_utils.c
+++ b/drivers/net/mlx5/mlx5_utils.c
@@ -11,20 +11,25 @@
 
 /********************* mlx5 list ************************/
 
-int
-mlx5_list_create(struct mlx5_list *list, const char *name, void *ctx,
+struct mlx5_list *
+mlx5_list_create(const char *name, void *ctx,
 		 mlx5_list_create_cb cb_create,
 		 mlx5_list_match_cb cb_match,
 		 mlx5_list_remove_cb cb_remove,
 		 mlx5_list_clone_cb cb_clone,
 		 mlx5_list_clone_free_cb cb_clone_free)
 {
+	struct mlx5_list *list;
 	int i;
 
-	MLX5_ASSERT(list);
 	if (!cb_match || !cb_create || !cb_remove || !cb_clone ||
-	    !cb_clone_free)
-		return -1;
+	    !cb_clone_free) {
+		rte_errno = EINVAL;
+		return NULL;
+	}
+	list = mlx5_malloc(MLX5_MEM_ZERO, sizeof(*list), 0, SOCKET_ID_ANY);
+	if (!list)
+		return NULL;
 	if (name)
 		snprintf(list->name, sizeof(list->name), "%s", name);
 	list->ctx = ctx;
@@ -37,7 +42,7 @@ mlx5_list_create(struct mlx5_list *list, const char *name, void *ctx,
 	DRV_LOG(DEBUG, "mlx5 list %s initialized.", list->name);
 	for (i = 0; i <= RTE_MAX_LCORE; i++)
 		LIST_INIT(&list->cache[i].h);
-	return 0;
+	return list;
 }
 
 static struct mlx5_list_entry *
@@ -244,7 +249,7 @@ mlx5_list_destroy(struct mlx5_list *list)
 			}
 		}
 	}
-	memset(list, 0, sizeof(*list));
+	mlx5_free(list);
 }
 
 uint32_t
diff --git a/drivers/net/mlx5/mlx5_utils.h b/drivers/net/mlx5/mlx5_utils.h
index 71da5ab4f9..ea64bb75c9 100644
--- a/drivers/net/mlx5/mlx5_utils.h
+++ b/drivers/net/mlx5/mlx5_utils.h
@@ -420,15 +420,14 @@ struct mlx5_list {
  * @param cb_remove
  *   Callback function for entry remove.
  * @return
- *   0 on success, otherwise failure.
+ *   List pointer on success, otherwise NULL.
  */
-int mlx5_list_create(struct mlx5_list *list,
-			 const char *name, void *ctx,
-			 mlx5_list_create_cb cb_create,
-			 mlx5_list_match_cb cb_match,
-			 mlx5_list_remove_cb cb_remove,
-			 mlx5_list_clone_cb cb_clone,
-			 mlx5_list_clone_free_cb cb_clone_free);
+struct mlx5_list *mlx5_list_create(const char *name, void *ctx,
+				   mlx5_list_create_cb cb_create,
+				   mlx5_list_match_cb cb_match,
+				   mlx5_list_remove_cb cb_remove,
+				   mlx5_list_clone_cb cb_clone,
+				   mlx5_list_clone_free_cb cb_clone_free);
 
 /**
  * Search an entry matching the key.
diff --git a/drivers/net/mlx5/windows/mlx5_os.c b/drivers/net/mlx5/windows/mlx5_os.c
index 8ced98f0dc..e6176e70d2 100644
--- a/drivers/net/mlx5/windows/mlx5_os.c
+++ b/drivers/net/mlx5/windows/mlx5_os.c
@@ -610,7 +610,7 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,
 			err = ENOTSUP;
 			goto error;
 	}
-	mlx5_list_create(&priv->hrxqs, "hrxq", eth_dev,
+	priv->hrxqs = mlx5_list_create("hrxq", eth_dev,
 		mlx5_hrxq_create_cb, mlx5_hrxq_match_cb,
 		mlx5_hrxq_remove_cb, mlx5_hrxq_clone_cb,
 		mlx5_hrxq_clone_free_cb);
