Commit 6cb5f3ea authored by Johannes Berg's avatar Johannes Berg
Browse files

mac80211: populate debugfs only after cfg80211 init



When fixing the initialization race, we neglected to account for
the fact that debugfs is initialized in wiphy_register(), and
some debugfs things went missing (or rather were rerooted to the
global debugfs root).

Fix this by adding debugfs entries only after wiphy_register().
This requires some changes in the rate control code since it
currently adds debugfs at alloc time, which can no longer be
done after the reordering.

Reported-by: default avatarJouni Malinen <j@w1.fi>
Reported-by: default avatarkernel test robot <rong.a.chen@intel.com>
Reported-by: default avatarHauke Mehrtens <hauke@hauke-m.de>
Reported-by: default avatarFelix Fietkau <nbd@nbd.name>
Cc: stable@vger.kernel.org
Fixes: 52e04b4c ("mac80211: fix race in ieee80211_register_hw()")
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Acked-by: default avatarSumit Garg <sumit.garg@linaro.org>
Link: https://lore.kernel.org/r/20200423111344.0e00d3346f12.Iadc76a03a55093d94391fc672e996a458702875d@changeid


Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 03798612
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -374,7 +374,7 @@ out:
}

static void *
il3945_rs_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir)
il3945_rs_alloc(struct ieee80211_hw *hw)
{
	return hw->priv;
}
+1 −1
Original line number Diff line number Diff line
@@ -2474,7 +2474,7 @@ il4965_rs_fill_link_cmd(struct il_priv *il, struct il_lq_sta *lq_sta,
}

static void *
il4965_rs_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir)
il4965_rs_alloc(struct ieee80211_hw *hw)
{
	return hw->priv;
}
+1 −1
Original line number Diff line number Diff line
@@ -3019,7 +3019,7 @@ static void rs_fill_link_cmd(struct iwl_priv *priv,
			cpu_to_le16(priv->lib->bt_params->agg_time_limit);
}

static void *rs_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir)
static void *rs_alloc(struct ieee80211_hw *hw)
{
	return hw->priv;
}
+1 −1
Original line number Diff line number Diff line
@@ -3665,7 +3665,7 @@ static void rs_fill_lq_cmd(struct iwl_mvm *mvm,
			cpu_to_le16(iwl_mvm_coex_agg_time_limit(mvm, sta));
}

static void *rs_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir)
static void *rs_alloc(struct ieee80211_hw *hw)
{
	return hw->priv;
}
+1 −1
Original line number Diff line number Diff line
@@ -261,7 +261,7 @@ static void rtl_rate_update(void *ppriv,
{
}

static void *rtl_rate_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir)
static void *rtl_rate_alloc(struct ieee80211_hw *hw)
{
	struct rtl_priv *rtlpriv = rtl_priv(hw);
	return rtlpriv;
Loading