From: Roi Dayan Date: Thu, 22 Sep 2022 08:03:30 +0000 (+0300) Subject: net/mlx5e: Warn when destroying mod hdr hash table that is not empty X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=2a1f4fed392b2b45e98acf9353a5a3827fb9dde3;p=linux.git net/mlx5e: Warn when destroying mod hdr hash table that is not empty To avoid memory leaks add a warn when destroying mod hdr hash table but the hash table is not empty. Signed-off-by: Roi Dayan Reviewed-by: Maor Dickman Signed-off-by: Saeed Mahameed --- diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/mod_hdr.c b/drivers/net/ethernet/mellanox/mlx5/core/en/mod_hdr.c index 17325c5d65160..cf60f0a3ff233 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/mod_hdr.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/mod_hdr.c @@ -47,6 +47,7 @@ void mlx5e_mod_hdr_tbl_init(struct mod_hdr_tbl *tbl) void mlx5e_mod_hdr_tbl_destroy(struct mod_hdr_tbl *tbl) { + WARN_ON(!hash_empty(tbl->hlist)); mutex_destroy(&tbl->lock); }