diff mbox series

[net,2/3] mwifiex: debugfs: Fix the NULL vs IS_ERR() bug for debugfs_create_dir()

Message ID 20230831141347.3166988-3-ruanjinjie@huawei.com
State New
Headers show
Series wifi: Fix the NULL vs IS_ERR() bugs for debugfs_create_dir() | expand

Commit Message

Jinjie Ruan Aug. 31, 2023, 2:13 p.m. UTC
Since debugfs_create_dir() returns ERR_PTR and never return NULL, So use
IS_ERR() to check it instead of checking NULL.

Fixes: 5e6e3a92b9a4 ("wireless: mwifiex: initial commit for Marvell mwifiex driver")
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
---
 drivers/net/wireless/marvell/mwifiex/debugfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/net/wireless/marvell/mwifiex/debugfs.c b/drivers/net/wireless/marvell/mwifiex/debugfs.c
index f9c9fec7c792..a1e074b6d539 100644
--- a/drivers/net/wireless/marvell/mwifiex/debugfs.c
+++ b/drivers/net/wireless/marvell/mwifiex/debugfs.c
@@ -970,7 +970,7 @@  mwifiex_dev_debugfs_init(struct mwifiex_private *priv)
 	priv->dfs_dev_dir = debugfs_create_dir(priv->netdev->name,
 					       mwifiex_dfs_dir);
 
-	if (!priv->dfs_dev_dir)
+	if (IS_ERR(priv->dfs_dev_dir))
 		return;
 
 	MWIFIEX_DFS_ADD_FILE(info);