提交 adb43b24 编写于 作者: M Michal Kazior 提交者: Kalle Valo

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: NMatteo Croce <matteo@openwrt.org>
Signed-off-by: NMichal Kazior <michal.kazior@tieto.com>
Signed-off-by: NKalle Valo <kvalo@qca.qualcomm.com>
上级 d5aebc77
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册