diff options
-rw-r--r-- | net/wireless/nl80211.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 1e728fff474e..31b807af3235 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -1908,6 +1908,11 @@ static int nl80211_get_mesh_params(struct sk_buff *skb, | |||
1908 | if (err) | 1908 | if (err) |
1909 | return err; | 1909 | return err; |
1910 | 1910 | ||
1911 | if (!drv->ops->get_mesh_params) { | ||
1912 | err = -EOPNOTSUPP; | ||
1913 | goto out; | ||
1914 | } | ||
1915 | |||
1911 | /* Get the mesh params */ | 1916 | /* Get the mesh params */ |
1912 | rtnl_lock(); | 1917 | rtnl_lock(); |
1913 | err = drv->ops->get_mesh_params(&drv->wiphy, dev, &cur_params); | 1918 | err = drv->ops->get_mesh_params(&drv->wiphy, dev, &cur_params); |
@@ -2017,6 +2022,11 @@ static int nl80211_set_mesh_params(struct sk_buff *skb, struct genl_info *info) | |||
2017 | if (err) | 2022 | if (err) |
2018 | return err; | 2023 | return err; |
2019 | 2024 | ||
2025 | if (!drv->ops->set_mesh_params) { | ||
2026 | err = -EOPNOTSUPP; | ||
2027 | goto out; | ||
2028 | } | ||
2029 | |||
2020 | /* This makes sure that there aren't more than 32 mesh config | 2030 | /* This makes sure that there aren't more than 32 mesh config |
2021 | * parameters (otherwise our bitfield scheme would not work.) */ | 2031 | * parameters (otherwise our bitfield scheme would not work.) */ |
2022 | BUILD_BUG_ON(NL80211_MESHCONF_ATTR_MAX > 32); | 2032 | BUILD_BUG_ON(NL80211_MESHCONF_ATTR_MAX > 32); |
@@ -2061,6 +2071,7 @@ static int nl80211_set_mesh_params(struct sk_buff *skb, struct genl_info *info) | |||
2061 | err = drv->ops->set_mesh_params(&drv->wiphy, dev, &cfg, mask); | 2071 | err = drv->ops->set_mesh_params(&drv->wiphy, dev, &cfg, mask); |
2062 | rtnl_unlock(); | 2072 | rtnl_unlock(); |
2063 | 2073 | ||
2074 | out: | ||
2064 | /* cleanup */ | 2075 | /* cleanup */ |
2065 | cfg80211_put_dev(drv); | 2076 | cfg80211_put_dev(drv); |
2066 | dev_put(dev); | 2077 | dev_put(dev); |