FIX: [wext] do not show INT_MIN as txpower value if nothing was configured

BugzId: 72713
This commit is contained in:
Patrick Walther 2021-05-17 16:13:34 +02:00
parent 4fb2e1d93b
commit dc032ec273
1 changed files with 14 additions and 0 deletions

View File

@ -649,3 +649,17 @@ index b6caa2b..fbe581a 100644
} }
static void handle_band_custom(struct wiphy *wiphy, static void handle_band_custom(struct wiphy *wiphy,
diff --git a/net/wireless/wext-compat.c b/net/wireless/wext-compat.c
index 78f2927..4fa5b0d 100644
--- a/net/wireless/wext-compat.c
+++ b/net/wireless/wext-compat.c
@@ -895,7 +895,8 @@ static int cfg80211_wext_giwtxpower(struct net_device *dev,
/* well... oh well */
data->txpower.fixed = 1;
data->txpower.disabled = rfkill_blocked(rdev->rfkill);
- data->txpower.value = val;
+ /* show same behavior as iw and show txpower 0dBm if not initialized */
+ data->txpower.value = val == INT_MIN ? 0 : val;
data->txpower.flags = IW_TXPOW_DBM;
return 0;