Skip to contentSkip to conversation

rsi_91x_usb: fix uninitialized variable

PATCH In review Gustavo A. R. Silva 2 participants 2 messages Apr 26, 2018 – Apr 30, 2018

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

PATCH 1/1 rsi_91x_usb: fix uninitialized variable

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")
---
 drivers/net/wireless/rsi/rsi_91x_usb.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/net/wireless/rsi/rsi_91x_usb.c +4 -3
index b065438..6ce6b75 100644
@@ -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;
 	}
Signature · 1 line
2.7.4
#1 lore raw

Re: rsi_91x: fix uninitialized variable

Quoted 9 lines · 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")

Patch applied to wireless-drivers-next.git, thanks.

48c6b5c9c118 rsi_91x: fix uninitialized variable

Signature · 3 lines
https://patchwork.kernel.org/patch/10365985/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches