linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][next] power: avs: fix uninitialized error return on failed cpr_read_fuse_uV call
@ 2020-01-06 12:05 Colin King
  2020-01-06 19:14 ` Bjorn Andersson
  0 siblings, 1 reply; 3+ messages in thread
From: Colin King @ 2020-01-06 12:05 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Niklas Cassel, Kevin Hilman,
	Nishanth Menon, Rafael J . Wysocki, Jorge Ramirez-Ortiz,
	Ulf Hansson, linux-arm-msm, linux-pm
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Currently when the call cpr_read_fuse_uV returns an error the value in the
uninitialized variable ret is returned. Fix this by instread returning the
error value in the variable uV.

Addresses-Coverity: ("Uninitialized scalar variable")
Fixes: bf6910abf548 ("power: avs: Add support for CPR (Core Power Reduction)")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/power/avs/qcom-cpr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/power/avs/qcom-cpr.c b/drivers/power/avs/qcom-cpr.c
index 9247f53550b3..0321729431a5 100644
--- a/drivers/power/avs/qcom-cpr.c
+++ b/drivers/power/avs/qcom-cpr.c
@@ -922,7 +922,7 @@ static int cpr_fuse_corner_init(struct cpr_drv *drv)
 		uV = cpr_read_fuse_uV(desc, fdata, fuses->init_voltage,
 				      step_volt, drv);
 		if (uV < 0)
-			return ret;
+			return uV;
 
 		fuse->min_uV = fdata->min_uV;
 		fuse->max_uV = fdata->max_uV;
-- 
2.24.0


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

* Re: [PATCH][next] power: avs: fix uninitialized error return on failed cpr_read_fuse_uV call
  2020-01-06 12:05 [PATCH][next] power: avs: fix uninitialized error return on failed cpr_read_fuse_uV call Colin King
@ 2020-01-06 19:14 ` Bjorn Andersson
  2020-01-07 10:59   ` Rafael J. Wysocki
  0 siblings, 1 reply; 3+ messages in thread
From: Bjorn Andersson @ 2020-01-06 19:14 UTC (permalink / raw)
  To: Colin King
  Cc: Andy Gross, Niklas Cassel, Kevin Hilman, Nishanth Menon,
	Rafael J . Wysocki, Jorge Ramirez-Ortiz, Ulf Hansson,
	linux-arm-msm, linux-pm, kernel-janitors, linux-kernel

On Mon 06 Jan 04:05 PST 2020, Colin King wrote:

> From: Colin Ian King <colin.king@canonical.com>
> 
> Currently when the call cpr_read_fuse_uV returns an error the value in the
> uninitialized variable ret is returned. Fix this by instread returning the
> error value in the variable uV.
> 

Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>

> Addresses-Coverity: ("Uninitialized scalar variable")
> Fixes: bf6910abf548 ("power: avs: Add support for CPR (Core Power Reduction)")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  drivers/power/avs/qcom-cpr.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/power/avs/qcom-cpr.c b/drivers/power/avs/qcom-cpr.c
> index 9247f53550b3..0321729431a5 100644
> --- a/drivers/power/avs/qcom-cpr.c
> +++ b/drivers/power/avs/qcom-cpr.c
> @@ -922,7 +922,7 @@ static int cpr_fuse_corner_init(struct cpr_drv *drv)
>  		uV = cpr_read_fuse_uV(desc, fdata, fuses->init_voltage,
>  				      step_volt, drv);
>  		if (uV < 0)
> -			return ret;
> +			return uV;
>  
>  		fuse->min_uV = fdata->min_uV;
>  		fuse->max_uV = fdata->max_uV;
> -- 
> 2.24.0
> 

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

* Re: [PATCH][next] power: avs: fix uninitialized error return on failed cpr_read_fuse_uV call
  2020-01-06 19:14 ` Bjorn Andersson
@ 2020-01-07 10:59   ` Rafael J. Wysocki
  0 siblings, 0 replies; 3+ messages in thread
From: Rafael J. Wysocki @ 2020-01-07 10:59 UTC (permalink / raw)
  To: Bjorn Andersson, Colin King
  Cc: Andy Gross, Niklas Cassel, Kevin Hilman, Nishanth Menon,
	Rafael J . Wysocki, Jorge Ramirez-Ortiz, Ulf Hansson,
	linux-arm-msm, Linux PM, kernel-janitors,
	Linux Kernel Mailing List

On Mon, Jan 6, 2020 at 8:15 PM Bjorn Andersson
<bjorn.andersson@linaro.org> wrote:
>
> On Mon 06 Jan 04:05 PST 2020, Colin King wrote:
>
> > From: Colin Ian King <colin.king@canonical.com>
> >
> > Currently when the call cpr_read_fuse_uV returns an error the value in the
> > uninitialized variable ret is returned. Fix this by instread returning the
> > error value in the variable uV.
> >
>
> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>

Applied, thanks!

> > Addresses-Coverity: ("Uninitialized scalar variable")
> > Fixes: bf6910abf548 ("power: avs: Add support for CPR (Core Power Reduction)")
> > Signed-off-by: Colin Ian King <colin.king@canonical.com>
> > ---
> >  drivers/power/avs/qcom-cpr.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/power/avs/qcom-cpr.c b/drivers/power/avs/qcom-cpr.c
> > index 9247f53550b3..0321729431a5 100644
> > --- a/drivers/power/avs/qcom-cpr.c
> > +++ b/drivers/power/avs/qcom-cpr.c
> > @@ -922,7 +922,7 @@ static int cpr_fuse_corner_init(struct cpr_drv *drv)
> >               uV = cpr_read_fuse_uV(desc, fdata, fuses->init_voltage,
> >                                     step_volt, drv);
> >               if (uV < 0)
> > -                     return ret;
> > +                     return uV;
> >
> >               fuse->min_uV = fdata->min_uV;
> >               fuse->max_uV = fdata->max_uV;
> > --

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

end of thread, other threads:[~2020-01-07 10:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-06 12:05 [PATCH][next] power: avs: fix uninitialized error return on failed cpr_read_fuse_uV call Colin King
2020-01-06 19:14 ` Bjorn Andersson
2020-01-07 10:59   ` Rafael J. Wysocki

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