summaryrefslogtreecommitdiff
path: root/net/mac80211/main.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2018-12-15 11:03:11 +0200
committerJohannes Berg <johannes.berg@intel.com>2018-12-18 13:17:26 +0100
commitdd665d23c1e94ad81d8720e90666030c5714a158 (patch)
tree8bc403094cd834226108304df95d4c8746fe565d /net/mac80211/main.c
parent8020919a9b99d6c990dc6a50e8215e291fbbe5a6 (diff)
mac80211: never pass NULL params to ieee80211_if_add()
This isn't really a problem now, but it means that the function has a few NULL checks that are only relevant when coming from the initial interface added in mac80211, and that's confusing. Just pass non-NULL (but equivalently empty) in that case and remove all the NULL checks. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/main.c')
-rw-r--r--net/mac80211/main.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 83e71e6b2ebe..ada8e16d52d2 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -1221,8 +1221,10 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
/* add one default STA interface if supported */
if (local->hw.wiphy->interface_modes & BIT(NL80211_IFTYPE_STATION) &&
!ieee80211_hw_check(hw, NO_AUTO_VIF)) {
+ struct vif_params params = {0};
+
result = ieee80211_if_add(local, "wlan%d", NET_NAME_ENUM, NULL,
- NL80211_IFTYPE_STATION, NULL);
+ NL80211_IFTYPE_STATION, &params);
if (result)
wiphy_warn(local->hw.wiphy,
"Failed to add default virtual iface\n");