diff mbox series

[4/8] wifi: wilc1000: set station_info flag only when signal value is valid

Message ID 20220720160302.231516-4-ajay.kathat@microchip.com
State New
Headers show
Series [1/8] wifi: wilc1000: fix incorrect type assignment sparse warning | expand

Commit Message

Ajay Singh July 20, 2022, 4:03 p.m. UTC
From: Ajay Singh <ajay.kathat@microchip.com>

Set station_info->filled to indicate signal level only when its value is
received successfully using wilc_get_rssi().

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
---
 drivers/net/wireless/microchip/wilc1000/cfg80211.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/net/wireless/microchip/wilc1000/cfg80211.c b/drivers/net/wireless/microchip/wilc1000/cfg80211.c
index 19862d932f1f..1e184ac93afa 100644
--- a/drivers/net/wireless/microchip/wilc1000/cfg80211.c
+++ b/drivers/net/wireless/microchip/wilc1000/cfg80211.c
@@ -1312,12 +1312,11 @@  static int dump_station(struct wiphy *wiphy, struct net_device *dev,
 	if (idx != 0)
 		return -ENOENT;
 
-	sinfo->filled |= BIT_ULL(NL80211_STA_INFO_SIGNAL);
-
 	ret = wilc_get_rssi(vif, &sinfo->signal);
 	if (ret)
 		return ret;
 
+	sinfo->filled |= BIT_ULL(NL80211_STA_INFO_SIGNAL);
 	memcpy(mac, vif->priv.associated_bss, ETH_ALEN);
 	return 0;
 }