xfs: respect the stable writes flag on the RT device
[platform/kernel/linux-starfive.git] / net / mac80211 / cfg.c
index 0e3a175..f7cb50b 100644 (file)
@@ -1806,10 +1806,10 @@ static int sta_link_apply_parameters(struct ieee80211_local *local,
                                          lockdep_is_held(&local->sta_mtx));
 
        /*
-        * If there are no changes, then accept a link that doesn't exist,
+        * If there are no changes, then accept a link that exist,
         * unless it's a new link.
         */
-       if (params->link_id < 0 && !new_link &&
+       if (params->link_id >= 0 && !new_link &&
            !params->link_mac && !params->txpwr_set &&
            !params->supported_rates_len &&
            !params->ht_capa && !params->vht_capa &&
@@ -3121,6 +3121,10 @@ static int ieee80211_get_tx_power(struct wiphy *wiphy,
        else
                *dbm = sdata->vif.bss_conf.txpower;
 
+       /* INT_MIN indicates no power level was set yet */
+       if (*dbm == INT_MIN)
+               return -EINVAL;
+
        return 0;
 }