diff options
Diffstat (limited to 'net/mac80211/cfg.c')
-rw-r--r-- | net/mac80211/cfg.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 297c257864c7..6d2ad2bf3ab5 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c | |||
@@ -66,13 +66,16 @@ static int ieee80211_add_iface(struct wiphy *wiphy, char *name, | |||
66 | static int ieee80211_del_iface(struct wiphy *wiphy, int ifindex) | 66 | static int ieee80211_del_iface(struct wiphy *wiphy, int ifindex) |
67 | { | 67 | { |
68 | struct net_device *dev; | 68 | struct net_device *dev; |
69 | struct ieee80211_sub_if_data *sdata; | ||
69 | 70 | ||
70 | /* we're under RTNL */ | 71 | /* we're under RTNL */ |
71 | dev = __dev_get_by_index(&init_net, ifindex); | 72 | dev = __dev_get_by_index(&init_net, ifindex); |
72 | if (!dev) | 73 | if (!dev) |
73 | return -ENODEV; | 74 | return -ENODEV; |
74 | 75 | ||
75 | ieee80211_if_remove(dev); | 76 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
77 | |||
78 | ieee80211_if_remove(sdata); | ||
76 | 79 | ||
77 | return 0; | 80 | return 0; |
78 | } | 81 | } |
@@ -842,13 +845,13 @@ static int ieee80211_add_mpath(struct wiphy *wiphy, struct net_device *dev, | |||
842 | return -ENOENT; | 845 | return -ENOENT; |
843 | } | 846 | } |
844 | 847 | ||
845 | err = mesh_path_add(dst, dev); | 848 | err = mesh_path_add(dst, sdata); |
846 | if (err) { | 849 | if (err) { |
847 | rcu_read_unlock(); | 850 | rcu_read_unlock(); |
848 | return err; | 851 | return err; |
849 | } | 852 | } |
850 | 853 | ||
851 | mpath = mesh_path_lookup(dst, dev); | 854 | mpath = mesh_path_lookup(dst, sdata); |
852 | if (!mpath) { | 855 | if (!mpath) { |
853 | rcu_read_unlock(); | 856 | rcu_read_unlock(); |
854 | return -ENXIO; | 857 | return -ENXIO; |
@@ -862,10 +865,12 @@ static int ieee80211_add_mpath(struct wiphy *wiphy, struct net_device *dev, | |||
862 | static int ieee80211_del_mpath(struct wiphy *wiphy, struct net_device *dev, | 865 | static int ieee80211_del_mpath(struct wiphy *wiphy, struct net_device *dev, |
863 | u8 *dst) | 866 | u8 *dst) |
864 | { | 867 | { |
868 | struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); | ||
869 | |||
865 | if (dst) | 870 | if (dst) |
866 | return mesh_path_del(dst, dev); | 871 | return mesh_path_del(dst, sdata); |
867 | 872 | ||
868 | mesh_path_flush(dev); | 873 | mesh_path_flush(sdata); |
869 | return 0; | 874 | return 0; |
870 | } | 875 | } |
871 | 876 | ||
@@ -897,7 +902,7 @@ static int ieee80211_change_mpath(struct wiphy *wiphy, | |||
897 | return -ENOENT; | 902 | return -ENOENT; |
898 | } | 903 | } |
899 | 904 | ||
900 | mpath = mesh_path_lookup(dst, dev); | 905 | mpath = mesh_path_lookup(dst, sdata); |
901 | if (!mpath) { | 906 | if (!mpath) { |
902 | rcu_read_unlock(); | 907 | rcu_read_unlock(); |
903 | return -ENOENT; | 908 | return -ENOENT; |
@@ -965,7 +970,7 @@ static int ieee80211_get_mpath(struct wiphy *wiphy, struct net_device *dev, | |||
965 | return -ENOTSUPP; | 970 | return -ENOTSUPP; |
966 | 971 | ||
967 | rcu_read_lock(); | 972 | rcu_read_lock(); |
968 | mpath = mesh_path_lookup(dst, dev); | 973 | mpath = mesh_path_lookup(dst, sdata); |
969 | if (!mpath) { | 974 | if (!mpath) { |
970 | rcu_read_unlock(); | 975 | rcu_read_unlock(); |
971 | return -ENOENT; | 976 | return -ENOENT; |
@@ -993,7 +998,7 @@ static int ieee80211_dump_mpath(struct wiphy *wiphy, struct net_device *dev, | |||
993 | return -ENOTSUPP; | 998 | return -ENOTSUPP; |
994 | 999 | ||
995 | rcu_read_lock(); | 1000 | rcu_read_lock(); |
996 | mpath = mesh_path_lookup_by_idx(idx, dev); | 1001 | mpath = mesh_path_lookup_by_idx(idx, sdata); |
997 | if (!mpath) { | 1002 | if (!mpath) { |
998 | rcu_read_unlock(); | 1003 | rcu_read_unlock(); |
999 | return -ENOENT; | 1004 | return -ENOENT; |