Subject: [net-next 08/15] net/mlx5e: Remove incorrect debugfs_create_dir NULL check in TLS

From: Saeed Mahameed <[email-masked]>
Date: Tue, 7 Feb 2023 16:37:05 -0800

From: Gal Pressman <[email-masked]>

Remove the NULL check on debugfs_create_dir() return value as the
function returns an ERR pointer on failure, not NULL.
The check is not replaced with a IS_ERR_OR_NULL() as
debugfs_create_file(), and debugfs functions in general don't need error
checking.

Fixes: 0fedee1ae9ef ("net/mlx5e: kTLS, Add debugfs")
Reported-by: Dan Carpenter <[email-masked]>
Signed-off-by: Gal Pressman <[email-masked]>
Reviewed-by: Tariq Toukan <[email-masked]>
Signed-off-by: Saeed Mahameed <[email-masked]>
---
 drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c
index e80b43b7aac9..60b3e08a1028 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c
@@ -899,8 +899,6 @@ static void mlx5e_tls_tx_debugfs_init(struct mlx5e_tls *tls,
 		return;
 
 	tls->debugfs.dfs_tx = debugfs_create_dir("tx", dfs_root);
-	if (!tls->debugfs.dfs_tx)
-		return;
 
 	debugfs_create_size_t("pool_size", 0400, tls->debugfs.dfs_tx,
 			      &tls->tx_pool->size);
-- 
2.39.1