drivers: wireless: ath5k: fix parameter check in ath5k_debug_init_device()
PATCH v2 1/1 drivers: wireless: ath5k: fix parameter check in ath5k_debug_init_device()
Make IS_ERR_OR_NULL() judge the debugfs_create_dir() function return in ath5k_debug_init_device().
---
v1-v2:
use IS_ERR_OR_NULL() instead of IS_ERR()
--- drivers/net/wireless/ath/ath5k/debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ath/ath5k/debug.c +1 -1
@@ -982,7 +982,7 @@ ath5k_debug_init_device(struct ath5k_hw *ah) ah->debug.level = ath5k_debug; phydir =debugfs_create_dir ("ath5k" , ah->hw->wiphy->debugfsdir); -if (!phydir) +if (IS_ERR_OR_NULL (phydir))return ;debugfs_create_file ("debug" ,0600 , phydir, ah, &fops_debug);
Signature · 1 line
2.39.0
Jiri Slaby
maintainerQuoted 17 lines · Minjie Du
Make
IS_ERR_OR_NULL()judge thedebugfs_create_dir()function return inath5k_debug_init_device().Signed-off-by Minjie Du <[email protected]>Acked-by Luis Chamberlain <[email protected]>---
v1-v2:
useIS_ERR_OR_NULL()instead ofIS_ERR()--- drivers/net/wireless/ath/ath5k/debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/wireless/ath/ath5k/debug.c +0
-0
drivers/net/wireless/ath/ath5k/debug.c ath5k_debug_init_device(struct ath5k_hw *ah) · line 985
Quoted 5 lines
drivers/net/wireless/ath/ath5k/debug.c +1
-1@@ -982,7 +982,7 @@ ath5k_debug_init_device(struct ath5k_hw *ah) ah->debug.level = ath5k_debug; phydir =debugfs_create_dir ("ath5k" , ah->hw->wiphy->debugfsdir); -if (!phydir) +if (IS_ERR_OR_NULL (phydir))
When can debugfs_create_dir() return NULL?
Quoted 3 lines
drivers/net/wireless/ath/ath5k/debug.c +0
-0return ;debugfs_create_file ("debug" ,0600 , phydir, ah, &fops_debug);
Signature · 2 lines
js suse labs
Jiri Slaby
maintainerQuoted 17 lines · Minjie Du
Make
IS_ERR_OR_NULL()judge thedebugfs_create_dir()function return inath5k_debug_init_device().Signed-off-by Minjie Du <[email protected]>Acked-by Luis Chamberlain <[email protected]>---
v1-v2:
useIS_ERR_OR_NULL()instead ofIS_ERR()--- drivers/net/wireless/ath/ath5k/debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/wireless/ath/ath5k/debug.c +0
-0
drivers/net/wireless/ath/ath5k/debug.c ath5k_debug_init_device(struct ath5k_hw *ah) · line 986
Quoted 6 lines
drivers/net/wireless/ath/ath5k/debug.c +1
-1@@ -982,7 +982,7 @@ ath5k_debug_init_device(struct ath5k_hw *ah) ah->debug.level = ath5k_debug; phydir =debugfs_create_dir ("ath5k" , ah->hw->wiphy->debugfsdir); -if (!phydir) +if (IS_ERR_OR_NULL (phydir))return ;
And actually, in this case, remove the check completely (as per docs).
thanks,
Signature · 2 lines
js suse labs