aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath10k/debug.c
diff options
context:
space:
mode:
authorMichal Kazior <[email protected]>2014-09-04 10:36:45 +0000
committerKalle Valo <[email protected]>2014-09-11 20:44:44 +0000
commitadb43b24ec12a008656dcca831ab835a94261963 (patch)
tree00062bdb2c54aa6d66b6550bab6e1ae879105c77 /drivers/net/wireless/ath/ath10k/debug.c
parentath10k: support firmware crash-by-assert (diff)
downloadkernel-adb43b24ec12a008656dcca831ab835a94261963.tar.gz
kernel-adb43b24ec12a008656dcca831ab835a94261963.zip
ath10k: fix debugfs_create_dir() checking
The function may return an -ENODEV if debugfs is disabled in kernel. This should originally be guarded by ath10k's Kconfig but it still makes sense to check for the non-NULL errno return value. Reported-by: Matteo Croce <[email protected]> Signed-off-by: Michal Kazior <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
Diffstat (limited to 'drivers/net/wireless/ath/ath10k/debug.c')
-rw-r--r--drivers/net/wireless/ath/ath10k/debug.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/net/wireless/ath/ath10k/debug.c b/drivers/net/wireless/ath/ath10k/debug.c
index c5d01058c2a3..c1921143a870 100644
--- a/drivers/net/wireless/ath/ath10k/debug.c
+++ b/drivers/net/wireless/ath/ath10k/debug.c
@@ -1176,8 +1176,12 @@ int ath10k_debug_register(struct ath10k *ar)
{
ar->debug.debugfs_phy = debugfs_create_dir("ath10k",
ar->hw->wiphy->debugfsdir);
- if (!ar->debug.debugfs_phy)
- return -ENOMEM;
+ if (IS_ERR_OR_NULL(ar->debug.debugfs_phy)) {
+ if (IS_ERR(ar->debug.debugfs_phy))
+ return PTR_ERR(ar->debug.debugfs_phy);
+ else
+ return -ENOMEM;
+ }
INIT_DELAYED_WORK(&ar->debug.htt_stats_dwork,
ath10k_debug_htt_stats_dwork);