diff mbox

rsi: Uninitialized return value in rsi_reset_card()

Message ID 20180426144235.GA25897@mwanda (mailing list archive)
State Rejected
Delegated to: Kalle Valo
Headers show

Commit Message

Dan Carpenter April 26, 2018, 2:42 p.m. UTC
If rsi_usb_master_reg_write() fails then "ret" hasn't been initialized.

Fixes: 16d3bb7b2f37 ("rsi: disable fw watchdog timer during reset")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Comments

Kalle Valo April 27, 2018, 12:14 p.m. UTC | #1
Dan Carpenter <dan.carpenter@oracle.com> writes:

> If rsi_usb_master_reg_write() fails then "ret" hasn't been initialized.
>
> Fixes: 16d3bb7b2f37 ("rsi: disable fw watchdog timer during reset")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/net/wireless/rsi/rsi_91x_usb.c b/drivers/net/wireless/rsi/rsi_91x_usb.c
> index b065438f51b2..6ce6b754df12 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) {

Odd, I thought I replied to this one already but I don't see my mail on
patchwork. Anyway, Gustavo already submitted an identical patch:

https://patchwork.kernel.org/patch/10365985/
diff mbox

Patch

diff --git a/drivers/net/wireless/rsi/rsi_91x_usb.c b/drivers/net/wireless/rsi/rsi_91x_usb.c
index b065438f51b2..6ce6b754df12 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;
 	}