linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ti: wl18xx: add checks on wl18xx_top_reg_write() return value
@ 2017-06-26 23:06 Gustavo A. R. Silva
  2017-06-28 16:38 ` Kalle Valo
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Gustavo A. R. Silva @ 2017-06-26 23:06 UTC (permalink / raw)
  To: Kalle Valo; +Cc: linux-wireless, netdev, linux-kernel, 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
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
 drivers/net/wireless/ti/wl18xx/main.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ti/wl18xx/main.c b/drivers/net/wireless/ti/wl18xx/main.c
index d1aa3ee..0cf3b40 100644
--- a/drivers/net/wireless/ti/wl18xx/main.c
+++ b/drivers/net/wireless/ti/wl18xx/main.c
@@ -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;
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: ti: wl18xx: add checks on wl18xx_top_reg_write() return value
  2017-06-26 23:06 [PATCH] ti: wl18xx: add checks on wl18xx_top_reg_write() return value Gustavo A. R. Silva
@ 2017-06-28 16:38 ` Kalle Valo
  2017-06-28 18:18 ` Kalle Valo
       [not found] ` <20170628163844.56F26601EA@smtp.codeaurora.org>
  2 siblings, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2017-06-28 16:38 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: linux-wireless, netdev, linux-kernel, Gustavo A. R. Silva

"Gustavo A. R. Silva" <garsilva@embeddedor.com> wrote:

> 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
> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>

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

-- 
https://patchwork.kernel.org/patch/9810591/

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: wl18xx: add checks on wl18xx_top_reg_write() return value
  2017-06-26 23:06 [PATCH] ti: wl18xx: add checks on wl18xx_top_reg_write() return value Gustavo A. R. Silva
  2017-06-28 16:38 ` Kalle Valo
@ 2017-06-28 18:18 ` Kalle Valo
       [not found] ` <20170628163844.56F26601EA@smtp.codeaurora.org>
  2 siblings, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2017-06-28 18:18 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: linux-wireless, netdev, linux-kernel, Gustavo A. R. Silva

"Gustavo A. R. Silva" <garsilva@embeddedor.com> wrote:

> 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
> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>

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

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

-- 
https://patchwork.kernel.org/patch/9810591/

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: ti: wl18xx: add checks on wl18xx_top_reg_write() return value
       [not found] ` <20170628163844.56F26601EA@smtp.codeaurora.org>
@ 2017-06-28 22:57   ` Gustavo A. R. Silva
  0 siblings, 0 replies; 4+ messages in thread
From: Gustavo A. R. Silva @ 2017-06-28 22:57 UTC (permalink / raw)
  To: Kalle Valo; +Cc: linux-wireless, netdev, linux-kernel


Quoting Kalle Valo <kvalo@codeaurora.org>:

> "Gustavo A. R. Silva" <garsilva@embeddedor.com> wrote:
>
>> 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
>> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
>
> The prefix should be "wl18xx:", I'll fix that.
>

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-06-28 22:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-26 23:06 [PATCH] ti: wl18xx: add checks on wl18xx_top_reg_write() return value Gustavo A. R. Silva
2017-06-28 16:38 ` Kalle Valo
2017-06-28 18:18 ` Kalle Valo
     [not found] ` <20170628163844.56F26601EA@smtp.codeaurora.org>
2017-06-28 22:57   ` ti: " Gustavo A. R. Silva

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).