[PATCH net 3/3] wifi: mt76: Fix the NULL vs IS_ERR() bug for debugfs_create_dir()
Jinjie Ruan
ruanjinjie at huawei.com
Thu Aug 31 07:13:47 PDT 2023
Since debugfs_create_dir() returns ERR_PTR and never return NULL, So use
IS_ERR() to check it instead of checking NULL.
Fixes: 17f1de56df05 ("mt76: add common code shared between multiple chipsets")
Signed-off-by: Jinjie Ruan <ruanjinjie at huawei.com>
---
drivers/net/wireless/mediatek/mt76/debugfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/mediatek/mt76/debugfs.c b/drivers/net/wireless/mediatek/mt76/debugfs.c
index 57fbcc83e074..d9ba700131fd 100644
--- a/drivers/net/wireless/mediatek/mt76/debugfs.c
+++ b/drivers/net/wireless/mediatek/mt76/debugfs.c
@@ -109,7 +109,7 @@ mt76_register_debugfs_fops(struct mt76_phy *phy,
struct dentry *dir;
dir = debugfs_create_dir("mt76", phy->hw->wiphy->debugfsdir);
- if (!dir)
+ if (IS_ERR(dir))
return NULL;
debugfs_create_u8("led_pin", 0600, dir, &phy->leds.pin);
--
2.34.1
More information about the Linux-mediatek
mailing list