mac80211: Fix deadlock when configuring wifi
[openwrt/staging/dedeckeh.git] / package / kernel / mac80211 / patches / subsys / 500-mac80211_configure_antenna_gain.patch
index 3f2cc182530adfaf9dc81ecd29d2b1762cce1fc2..821032fa893679495ce3ea9c7e3ead935874442c 100644 (file)
  };
  
  /* policy for the key attributes */
-@@ -3325,6 +3326,20 @@ static int nl80211_set_wiphy(struct sk_b
+@@ -3324,6 +3325,22 @@ static int nl80211_set_wiphy(struct sk_b
+               if (result)
                        goto out;
        }
++
 +      if (info->attrs[NL80211_ATTR_WIPHY_ANTENNA_GAIN]) {
 +              int idx, dbi = 0;
 +
-+              if (!rdev->ops->set_antenna_gain)
-+                      return -EOPNOTSUPP;
++              if (!rdev->ops->set_antenna_gain) {
++                      result = -EOPNOTSUPP;
++                      goto out;
++              }
 +
 +              idx = NL80211_ATTR_WIPHY_ANTENNA_GAIN;
 +              dbi = nla_get_u32(info->attrs[idx]);
 +
 +              result = rdev->ops->set_antenna_gain(&rdev->wiphy, dbi);
 +              if (result)
-+                      return result;
++                      goto out;
 +      }
-+
        if (info->attrs[NL80211_ATTR_WIPHY_TX_POWER_SETTING]) {
                struct wireless_dev *txp_wdev = wdev;
-               enum nl80211_tx_power_setting type;