mac80211: push interface checks down
This patch pushes the "netif_running()" and "same type as before" checks down into ieee80211_if_change_type() to centralise the logic instead of duplicating it for cfg80211 and wext. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:

committed by
John W. Linville

parent
75636525fb
commit
f3947e2dfa
@@ -296,14 +296,7 @@ static int ieee80211_ioctl_siwmode(struct net_device *dev,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (type == sdata->vif.type)
|
||||
return 0;
|
||||
if (netif_running(dev))
|
||||
return -EBUSY;
|
||||
|
||||
ieee80211_if_change_type(sdata, type);
|
||||
|
||||
return 0;
|
||||
return ieee80211_if_change_type(sdata, type);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user