summaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2015-06-10 20:18:55 +0300
committerJohannes Berg <johannes.berg@intel.com>2015-07-17 15:38:09 +0200
commit6513e98e05ccb8eca77adaf93beae44aa7bf4a45 (patch)
treebc07eec4c9ba58db59e6de2e33aa7d87246e8472 /net/mac80211
parente996ec2a4ddb53164262990d33304c429709f687 (diff)
downloadlinux-6513e98e05ccb8eca77adaf93beae44aa7bf4a45.tar.bz2
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')
-rw-r--r--net/mac80211/util.c7
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);
struct wireless_dev *ieee80211_vif_to_wdev(struct ieee80211_vif *vif)
{
- struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif);
+ struct ieee80211_sub_if_data *sdata;
+
+ if (!vif)
+ return NULL;
+
+ sdata = vif_to_sdata(vif);
if (!ieee80211_sdata_running(sdata) ||
!(sdata->flags & IEEE80211_SDATA_IN_DRIVER))