All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] clk: imx: pllv2: avoid using uninitialized values
@ 2018-01-17 15:02 ` Lucas Stach
  0 siblings, 0 replies; 6+ messages in thread
From: Lucas Stach @ 2018-01-17 15:02 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd
  Cc: Shawn Guo, Fabio Estevam, linux-arm-kernel, linux-clk, kernel,
	patchwork-lst

Forward the errors returned by __clk_pllv2_set_rate() in the recalc rate
function, to avoid using uninitialized values for the rate calculation.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
---
 drivers/clk/imx/clk-pllv2.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/imx/clk-pllv2.c b/drivers/clk/imx/clk-pllv2.c
index 85b5cbe9744c..eeba3cb14e2d 100644
--- a/drivers/clk/imx/clk-pllv2.c
+++ b/drivers/clk/imx/clk-pllv2.c
@@ -182,8 +182,12 @@ static long clk_pllv2_round_rate(struct clk_hw *hw, unsigned long rate,
 		unsigned long *prate)
 {
 	u32 dp_op, dp_mfd, dp_mfn;
+	int ret;
+
+	ret = __clk_pllv2_set_rate(rate, *prate, &dp_op, &dp_mfd, &dp_mfn);
+	if (ret)
+		return ret;
 
-	__clk_pllv2_set_rate(rate, *prate, &dp_op, &dp_mfd, &dp_mfn);
 	return __clk_pllv2_recalc_rate(*prate, MXC_PLL_DP_CTL_DPDCK0_2_EN,
 			dp_op, dp_mfd, dp_mfn);
 }
-- 
2.11.0

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

* [PATCH] clk: imx: pllv2: avoid using uninitialized values
@ 2018-01-17 15:02 ` Lucas Stach
  0 siblings, 0 replies; 6+ messages in thread
From: Lucas Stach @ 2018-01-17 15:02 UTC (permalink / raw)
  To: linux-arm-kernel

Forward the errors returned by __clk_pllv2_set_rate() in the recalc rate
function, to avoid using uninitialized values for the rate calculation.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
---
 drivers/clk/imx/clk-pllv2.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/imx/clk-pllv2.c b/drivers/clk/imx/clk-pllv2.c
index 85b5cbe9744c..eeba3cb14e2d 100644
--- a/drivers/clk/imx/clk-pllv2.c
+++ b/drivers/clk/imx/clk-pllv2.c
@@ -182,8 +182,12 @@ static long clk_pllv2_round_rate(struct clk_hw *hw, unsigned long rate,
 		unsigned long *prate)
 {
 	u32 dp_op, dp_mfd, dp_mfn;
+	int ret;
+
+	ret = __clk_pllv2_set_rate(rate, *prate, &dp_op, &dp_mfd, &dp_mfn);
+	if (ret)
+		return ret;
 
-	__clk_pllv2_set_rate(rate, *prate, &dp_op, &dp_mfd, &dp_mfn);
 	return __clk_pllv2_recalc_rate(*prate, MXC_PLL_DP_CTL_DPDCK0_2_EN,
 			dp_op, dp_mfd, dp_mfn);
 }
-- 
2.11.0

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

* Re: [PATCH] clk: imx: pllv2: avoid using uninitialized values
  2018-01-17 15:02 ` Lucas Stach
@ 2018-01-17 18:52   ` Fabio Estevam
  -1 siblings, 0 replies; 6+ messages in thread
From: Fabio Estevam @ 2018-01-17 18:52 UTC (permalink / raw)
  To: Lucas Stach
  Cc: Michael Turquette, Stephen Boyd, Shawn Guo, Fabio Estevam,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
	linux-clk, Sascha Hauer, patchwork-lst

On Wed, Jan 17, 2018 at 1:02 PM, Lucas Stach <l.stach@pengutronix.de> wrote:
> Forward the errors returned by __clk_pllv2_set_rate() in the recalc rate
> function, to avoid using uninitialized values for the rate calculation.
>
> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>

Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>

Thanks

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

* [PATCH] clk: imx: pllv2: avoid using uninitialized values
@ 2018-01-17 18:52   ` Fabio Estevam
  0 siblings, 0 replies; 6+ messages in thread
From: Fabio Estevam @ 2018-01-17 18:52 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jan 17, 2018 at 1:02 PM, Lucas Stach <l.stach@pengutronix.de> wrote:
> Forward the errors returned by __clk_pllv2_set_rate() in the recalc rate
> function, to avoid using uninitialized values for the rate calculation.
>
> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>

Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>

Thanks

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

* Re: [PATCH] clk: imx: pllv2: avoid using uninitialized values
  2018-01-17 15:02 ` Lucas Stach
@ 2018-03-16 22:41   ` Stephen Boyd
  -1 siblings, 0 replies; 6+ messages in thread
From: Stephen Boyd @ 2018-03-16 22:41 UTC (permalink / raw)
  To: Lucas Stach, Michael Turquette, Stephen Boyd
  Cc: Shawn Guo, Fabio Estevam, linux-arm-kernel, linux-clk, kernel,
	patchwork-lst

Quoting Lucas Stach (2018-01-17 07:02:56)
> Forward the errors returned by __clk_pllv2_set_rate() in the recalc rate
> function, to avoid using uninitialized values for the rate calculation.
> =

> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
> ---

Applied to clk-next

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

* [PATCH] clk: imx: pllv2: avoid using uninitialized values
@ 2018-03-16 22:41   ` Stephen Boyd
  0 siblings, 0 replies; 6+ messages in thread
From: Stephen Boyd @ 2018-03-16 22:41 UTC (permalink / raw)
  To: linux-arm-kernel

Quoting Lucas Stach (2018-01-17 07:02:56)
> Forward the errors returned by __clk_pllv2_set_rate() in the recalc rate
> function, to avoid using uninitialized values for the rate calculation.
> 
> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
> ---

Applied to clk-next

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

end of thread, other threads:[~2018-03-16 22:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-17 15:02 [PATCH] clk: imx: pllv2: avoid using uninitialized values Lucas Stach
2018-01-17 15:02 ` Lucas Stach
2018-01-17 18:52 ` Fabio Estevam
2018-01-17 18:52   ` Fabio Estevam
2018-03-16 22:41 ` Stephen Boyd
2018-03-16 22:41   ` Stephen Boyd

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.