2023-07-12 11:49:56

by Minjie Du

[permalink] [raw]
Subject: [PATCH v1] net: wireless: ath9k: fix parameter check in ath9k_init_debug()

Make IS_ERR() judge the debugfs_create_dir() function return
in ath9k_init_debug()

Signed-off-by: Minjie Du <[email protected]>
---
drivers/net/wireless/ath/ath9k/debug.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c
index fb7a2952d..995c6e705 100644
--- a/drivers/net/wireless/ath/ath9k/debug.c
+++ b/drivers/net/wireless/ath/ath9k/debug.c
@@ -1420,7 +1420,7 @@ int ath9k_init_debug(struct ath_hw *ah)

sc->debug.debugfs_phy = debugfs_create_dir("ath9k",
sc->hw->wiphy->debugfsdir);
- if (!sc->debug.debugfs_phy)
+ if (IS_ERR(sc->debug.debugfs_phy))
return -ENOMEM;

#ifdef CONFIG_ATH_DEBUG
--
2.39.0



2023-08-08 17:27:02

by Toke Høiland-Jørgensen

[permalink] [raw]
Subject: Re: [PATCH v1] net: wireless: ath9k: fix parameter check in ath9k_init_debug()

Minjie Du <[email protected]> writes:

> Make IS_ERR() judge the debugfs_create_dir() function return
> in ath9k_init_debug()
>
> Signed-off-by: Minjie Du <[email protected]>

Acked-by: Toke Høiland-Jørgensen <[email protected]>