Skip to contentSkip to conversation

ti: wl18xx: add checks on wl18xx_top_reg_write() return value

PATCH In review Gustavo A. R. Silva 2 participants 4 messages Jun 26, 2017 – Jun 28, 2017 1 message not in the archive

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

PATCH 1/1 ti: wl18xx: add checks on wl18xx_top_reg_write() return value

Check return value from call to wl18xx_top_reg_write(), so in case of error jump to goto label out and return.

Also, remove unnecessary value check before goto label out.

Addresses-Coverity-ID: 1226938

---
 drivers/net/wireless/ti/wl18xx/main.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/wireless/ti/wl18xx/main.c +4 -2
index d1aa3ee..0cf3b40 100644
@@ -793,9 +793,13 @@ static int wl18xx_set_clk(struct wl1271 *wl)
 		ret = wl18xx_top_reg_write(wl, PLLSH_WCS_PLL_P_FACTOR_CFG_2,
 					(wl18xx_clk_table[clk_freq].p >> 16) &
 					PLLSH_WCS_PLL_P_FACTOR_CFG_2_MASK);
+		if (ret < 0)
+			goto out;
 	} else {
 		ret = wl18xx_top_reg_write(wl, PLLSH_WCS_PLL_SWALLOW_EN,
 					   PLLSH_WCS_PLL_SWALLOW_EN_VAL2);
+		if (ret < 0)
+			goto out;
 	}
 
 	/* choose WCS PLL */
@@ -819,8 +823,6 @@ static int wl18xx_set_clk(struct wl1271 *wl)
 	/* reset the swallowing logic */
 	ret = wl18xx_top_reg_write(wl, PLLSH_COEX_PLL_SWALLOW_EN,
 				   PLLSH_COEX_PLL_SWALLOW_EN_VAL2);
-	if (ret < 0)
-		goto out;
 
 out:
 	return ret;
Signature · 1 line
2.5.0
#1 lore raw
Quoted 7 lines · Gustavo A. R. Silva

Check return value from call to wl18xx_top_reg_write(), so in case of error jump to goto label out and return.

Also, remove unnecessary value check before goto label out.

Addresses-Coverity-ID: 1226938

The prefix should be "wl18xx:", I'll fix that.

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

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
#2 lore raw

Re: wl18xx: add checks on wl18xx_top_reg_write() return value

In reply to Gustavo A. R. Silva
Quoted 7 lines · Gustavo A. R. Silva

Check return value from call to wl18xx_top_reg_write(), so in case of error jump to goto label out and return.

Also, remove unnecessary value check before goto label out.

Addresses-Coverity-ID: 1226938

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

059c98599b1a wl18xx: add checks on wl18xx_top_reg_write() return value

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

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

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw

Quoting Kalle Valo <[email protected]>:

Quoted 5 lines
Quoted 3 lines · Gustavo A. R. Silva

Check return value from call to wl18xx_top_reg_write(), so in case of error jump to goto label out and return.

Quoted 7 lines
Quoted 4 lines

Also, remove unnecessary value check before goto label out.

Addresses-Coverity-ID: 1226938

The prefix should be "wl18xx:", I'll fix that.

Thanks, Kalle.
--
Gustavo A. R. Silva