Skip to contentSkip to conversation

ath5k: eliminate warning unintialized variable warning

PATCH New John W. Linville 3 participants 4 messages Aug 30, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ath5k: eliminate warning unintialized variable warning

ath5k/base.c:1317: warning: ‘ret’ may be used uninitialized in this function

---

 0 files changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 drivers/net/wireless/ath/base.c
drivers/net/wireless/ath/base.c new file +0 -0
new file mode 100644
index 0000000..e69de29
Signature · 1 line
1.7.2.2
#1 lore raw

PATCH 1/1 ath5k: eliminate warning unintialized variable warning

From: John W. Linville <[email protected]>

ath5k/base.c:1317: warning: ‘ret’ may be used uninitialized in this function

---
Actually include patch this time...

 drivers/net/wireless/ath/ath5k/base.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
drivers/net/wireless/ath/ath5k/base.c +3 -1
index 7139c7e..116ac66 100644
@@ -1327,8 +1327,10 @@ ath5k_txbuf_setup(struct ath5k_softc *sc, struct ath5k_buf *bf,
 			PCI_DMA_TODEVICE);
 
 	rate = ieee80211_get_tx_rate(sc->hw, info);
-	if (!rate)
+	if (!rate) {
+		ret = -EINVAL;
 		goto err_unmap;
+	}
 
 	if (info->flags & IEEE80211_TX_CTL_NO_ACK)
 		flags |= AR5K_TXDESC_NOACK;
Signature · 1 line
1.7.2.2
#2 lore raw

PATCH 1/1 ath5k: eliminate warning unintialized variable warning

In reply to John W. Linville

ath5k/base.c:1317: warning: ‘ret’ may be used uninitialized in this function

---
Actually include patch this time...
With right sender info this time...

 drivers/net/wireless/ath/ath5k/base.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
drivers/net/wireless/ath/ath5k/base.c +3 -1
index 7139c7e..116ac66 100644
@@ -1327,8 +1327,10 @@ ath5k_txbuf_setup(struct ath5k_softc *sc, struct ath5k_buf *bf,
 			PCI_DMA_TODEVICE);
 
 	rate = ieee80211_get_tx_rate(sc->hw, info);
-	if (!rate)
+	if (!rate) {
+		ret = -EINVAL;
 		goto err_unmap;
+	}
 
 	if (info->flags & IEEE80211_TX_CTL_NO_ACK)
 		flags |= AR5K_TXDESC_NOACK;
Signature · 1 line
1.7.2.2