diff options
author | Johannes Berg <johannes.berg@intel.com> | 2018-12-15 11:03:11 +0200 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2018-12-18 13:17:26 +0100 |
commit | dd665d23c1e94ad81d8720e90666030c5714a158 (patch) | |
tree | 8bc403094cd834226108304df95d4c8746fe565d /net/mac80211/iface.c | |
parent | 8020919a9b99d6c990dc6a50e8215e291fbbe5a6 (diff) | |
download | linux-stable-dd665d23c1e94ad81d8720e90666030c5714a158.tar.gz linux-stable-dd665d23c1e94ad81d8720e90666030c5714a158.tar.bz2 linux-stable-dd665d23c1e94ad81d8720e90666030c5714a158.zip |
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/iface.c')
-rw-r--r-- | net/mac80211/iface.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index 5836ddeac9e3..6944ec7b6245 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c @@ -1799,7 +1799,7 @@ int ieee80211_if_add(struct ieee80211_local *local, const char *name, } ieee80211_assign_perm_addr(local, ndev->perm_addr, type); - if (params && is_valid_ether_addr(params->macaddr)) + if (is_valid_ether_addr(params->macaddr)) memcpy(ndev->dev_addr, params->macaddr, ETH_ALEN); else memcpy(ndev->dev_addr, ndev->perm_addr, ETH_ALEN); @@ -1868,11 +1868,9 @@ int ieee80211_if_add(struct ieee80211_local *local, const char *name, ieee80211_setup_sdata(sdata, type); if (ndev) { - if (params) { - ndev->ieee80211_ptr->use_4addr = params->use_4addr; - if (type == NL80211_IFTYPE_STATION) - sdata->u.mgd.use_4addr = params->use_4addr; - } + ndev->ieee80211_ptr->use_4addr = params->use_4addr; + if (type == NL80211_IFTYPE_STATION) + sdata->u.mgd.use_4addr = params->use_4addr; ndev->features |= local->hw.netdev_features; |