diff options
author | Johannes Berg <johannes.berg@intel.com> | 2015-06-10 13:18:55 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2015-07-17 09:38:09 -0400 |
commit | 6513e98e05ccb8eca77adaf93beae44aa7bf4a45 (patch) | |
tree | bc07eec4c9ba58db59e6de2e33aa7d87246e8472 /net/mac80211/util.c | |
parent | e996ec2a4ddb53164262990d33304c429709f687 (diff) |
mac80211: allow passing NULL to ieee80211_vif_to_wdev()
Simply return NULL in this case, instead of crashing. This can
simplify callers that would otherwise have to check for this
explicitly.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/util.c')
-rw-r--r-- | net/mac80211/util.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/net/mac80211/util.c b/net/mac80211/util.c index 7fb2c7bacc8c..89e089c452c1 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c | |||
@@ -703,7 +703,12 @@ EXPORT_SYMBOL_GPL(wdev_to_ieee80211_vif); | |||
703 | 703 | ||
704 | struct wireless_dev *ieee80211_vif_to_wdev(struct ieee80211_vif *vif) | 704 | struct wireless_dev *ieee80211_vif_to_wdev(struct ieee80211_vif *vif) |
705 | { | 705 | { |
706 | struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif); | 706 | struct ieee80211_sub_if_data *sdata; |
707 | |||
708 | if (!vif) | ||
709 | return NULL; | ||
710 | |||
711 | sdata = vif_to_sdata(vif); | ||
707 | 712 | ||
708 | if (!ieee80211_sdata_running(sdata) || | 713 | if (!ieee80211_sdata_running(sdata) || |
709 | !(sdata->flags & IEEE80211_SDATA_IN_DRIVER)) | 714 | !(sdata->flags & IEEE80211_SDATA_IN_DRIVER)) |