staging: wfx: avoid uninitialized variable use
PATCH 1/1 staging: wfx: avoid uninitialized variable use
From: Arnd Bergmann <[email protected]>
Move the added check of the 'band' variable after the initialization. Pointed out by clang with
drivers/staging/wfx/data_tx.c:34:19: warning: variable 'band' is uninitialized when used here [-Wuninitialized]
if (rate->idx >= band->n_bitrates) {--- drivers/staging/wfx/data_tx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/wfx/data_tx.c +3 -3
@@ -31,13 +31,13 @@ static int wfx_get_hw_rate(struct wfx_dev *wdev, }return rate->idx +14 ; } +// WFx only support 2GHz, else band information should be retrieved +// from ieee80211_tx_info + band = wdev->hw->wiphy->bands[NL80211_BAND_2GHZ ];if (rate->idx >= band->n_bitrates) {WARN (1 ,"wrong rate->idx value: %d" , rate->idx);return -1 ; } -// WFx only support 2GHz, else band information should be retrieved -// from ieee80211_tx_info - band = wdev->hw->wiphy->bands[NL80211_BAND_2GHZ ];return band->bitrates[rate->idx].hw_value; }
Signature · 1 line
2.27.0
Quoted 8 lines · On Monday 26 October 2020 17:02:22 CET Arnd Bergmann wrote:
From: Arnd Bergmann <[email protected]>
Move the added check of the 'band' variable after the initialization. Pointed out by clang with
drivers/staging/wfx/data_tx.c:34:19: warning: variable 'band' is uninitialized when used here [-Wuninitialized]if (rate->idx >= band->n_bitrates) {
Hello Arnd,
This patch has already been submitted[1]. I think it is going to be applied to staging very soon.
Sorry for the disturbing.
[1] https://lore.kernel.org/driverdev-devel/[email protected]/
Signature · 1 line
Jérôme Pouiller
Greg Kroah-Hartman
maintainerQuoted 10 lines · Jérôme Pouiller
Quoted 8 lines · On Monday 26 October 2020 17:02:22 CET Arnd Bergmann wrote:
From: Arnd Bergmann <[email protected]>
Move the added check of the 'band' variable after the initialization. Pointed out by clang with
drivers/staging/wfx/data_tx.c:34:19: warning: variable 'band' is uninitialized when used here [-Wuninitialized]if (rate->idx >= band->n_bitrates) {
Quoted 8 lines
Hello Arnd,
This patch has already been submitted[1]. I think it is going to be applied to staging very soon.
Sorry for the disturbing.
[1] https://lore.kernel.org/driverdev-devel/[email protected]/
Sorry for the delay, had to wait until -rc1 was out.
Now queued up in my tree.
greg k-h