* [PATCH] rsi_91x_usb: fix uninitialized variable
@ 2018-04-26 13:13 Gustavo A. R. Silva
2018-04-30 10:34 ` rsi_91x: " Kalle Valo
0 siblings, 1 reply; 2+ messages in thread
From: Gustavo A. R. Silva @ 2018-04-26 13:13 UTC (permalink / raw)
To: Amitkumar Karwar, Kalle Valo
Cc: linux-wireless, netdev, linux-kernel, Gustavo A. R. Silva
There is a potential execution path in which variable ret is returned
without being properly initialized previously.
Fix this by storing the value returned by function
rsi_usb_master_reg_write into _ret_.
Addresses-Coverity-ID: 1468407 ("Uninitialized scalar variable")
Fixes: 16d3bb7b2f37 ("rsi: disable fw watchdog timer during reset")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
drivers/net/wireless/rsi/rsi_91x_usb.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/rsi/rsi_91x_usb.c b/drivers/net/wireless/rsi/rsi_91x_usb.c
index b065438..6ce6b75 100644
--- a/drivers/net/wireless/rsi/rsi_91x_usb.c
+++ b/drivers/net/wireless/rsi/rsi_91x_usb.c
@@ -687,9 +687,10 @@ static int rsi_reset_card(struct rsi_hw *adapter)
*/
msleep(100);
- if (rsi_usb_master_reg_write(adapter, SWBL_REGOUT,
- RSI_FW_WDT_DISABLE_REQ,
- RSI_COMMON_REG_SIZE) < 0) {
+ ret = rsi_usb_master_reg_write(adapter, SWBL_REGOUT,
+ RSI_FW_WDT_DISABLE_REQ,
+ RSI_COMMON_REG_SIZE);
+ if (ret < 0) {
rsi_dbg(ERR_ZONE, "Disabling firmware watchdog timer failed\n");
goto fail;
}
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: rsi_91x: fix uninitialized variable
2018-04-26 13:13 [PATCH] rsi_91x_usb: fix uninitialized variable Gustavo A. R. Silva
@ 2018-04-30 10:34 ` Kalle Valo
0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2018-04-30 10:34 UTC (permalink / raw)
To: Gustavo A. R. Silva
Cc: Amitkumar Karwar, linux-wireless, netdev, linux-kernel,
Gustavo A. R. Silva
"Gustavo A. R. Silva" <gustavo@embeddedor.com> wrote:
> There is a potential execution path in which variable ret is returned
> without being properly initialized previously.
>
> Fix this by storing the value returned by function
> rsi_usb_master_reg_write into _ret_.
>
> Addresses-Coverity-ID: 1468407 ("Uninitialized scalar variable")
> Fixes: 16d3bb7b2f37 ("rsi: disable fw watchdog timer during reset")
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Patch applied to wireless-drivers-next.git, thanks.
48c6b5c9c118 rsi_91x: fix uninitialized variable
--
https://patchwork.kernel.org/patch/10365985/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-04-30 10:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-26 13:13 [PATCH] rsi_91x_usb: fix uninitialized variable Gustavo A. R. Silva
2018-04-30 10:34 ` rsi_91x: " Kalle Valo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).