mac80211: ibss: handle cfg80211_chandef_dfs_required() error codes
authorLuciano Coelho <luciano.coelho@intel.com>
Thu, 20 Feb 2014 14:36:23 +0000 (16:36 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 21 Feb 2014 08:37:46 +0000 (09:37 +0100)
Error codes returned by cfg80211_chandef_dfs_required() are ignored
when trying to join an IBSS.  Fix this by printing an error and
returning.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/ibss.c

index 4453e2725e407b2650376f1682d183376341e99d..e458ca0dffec12fcaca7e614eb14204760ca9b17 100644 (file)
@@ -283,6 +283,11 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
 
        err = cfg80211_chandef_dfs_required(sdata->local->hw.wiphy,
                                            &chandef);
+       if (err < 0) {
+               sdata_info(sdata,
+                          "Failed to join IBSS, invalid chandef\n");
+               return;
+       }
        if (err > 0) {
                if (!ifibss->userspace_handles_dfs) {
                        sdata_info(sdata,