Skip to content

Commit

Permalink
mac80211: allow passing NULL to ieee80211_vif_to_wdev()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Johannes Berg committed Jul 17, 2015
1 parent e996ec2 commit 6513e98
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion net/mac80211/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 6513e98

Please sign in to comment.