2010-08-30 18:14:45

by John W. Linville

[permalink] [raw]
Subject: [PATCH] ath5k: eliminate warning unintialized variable warning

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

Reported-by: Johannes Berg <[email protected]>
Signed-off-by: John W. Linville <[email protected]>
---
0 files changed, 0 insertions(+), 0 deletions(-)
create mode 100644 drivers/net/wireless/ath/base.c

diff --git a/drivers/net/wireless/ath/base.c b/drivers/net/wireless/ath/base.c
new file mode 100644
index 0000000..e69de29
--
1.7.2.2



2010-08-30 18:48:50

by Bob Copeland

[permalink] [raw]
Subject: Re: [PATCH] ath5k: eliminate warning unintialized variable warning

On Mon, Aug 30, 2010 at 02:21:56PM -0400, John W. Linville wrote:
> ath5k/base.c:1317: warning: ‘ret’ may be used uninitialized in this function
>
> Reported-by: Johannes Berg <[email protected]>
> Signed-off-by: John W. Linville <[email protected]>

Thanks,

Acked-by: Bob Copeland <[email protected]>

The first one was cc: stable, do we need to do that too or just
give them a rolled up patch?

--
Bob Copeland %% http://www.bobcopeland.com


2010-08-30 18:19:51

by y

[permalink] [raw]
Subject: [PATCH] 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

Reported-by: Johannes Berg <[email protected]>
Signed-off-by: John W. Linville <[email protected]>
---
Actually include patch this time...

drivers/net/wireless/ath/ath5k/base.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index 7139c7e..116ac66 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -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;
--
1.7.2.2


2010-08-30 18:21:46

by John W. Linville

[permalink] [raw]
Subject: [PATCH] ath5k: eliminate warning unintialized variable warning

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

Reported-by: Johannes Berg <[email protected]>
Signed-off-by: John W. Linville <[email protected]>
---
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(-)

diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index 7139c7e..116ac66 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -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;
--
1.7.2.2