From: Bjorn Andersson <bjorn.andersson@linaro.org>
To: Colin King <colin.king@canonical.com>
Cc: Andy Gross <agross@kernel.org>,
Niklas Cassel <niklas.cassel@linaro.org>,
Kevin Hilman <khilman@kernel.org>, Nishanth Menon <nm@ti.com>,
"Rafael J . Wysocki" <rafael.j.wysocki@intel.com>,
Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>,
Ulf Hansson <ulf.hansson@linaro.org>,
linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org,
kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH][next] power: avs: fix uninitialized error return on failed cpr_read_fuse_uV call
Date: Mon, 6 Jan 2020 11:14:58 -0800 [thread overview]
Message-ID: <20200106191458.GV3755841@builder> (raw)
In-Reply-To: <20200106120558.37758-1-colin.king@canonical.com>
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
>
next prev parent reply other threads:[~2020-01-06 19:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2020-01-07 10:59 ` Rafael J. Wysocki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200106191458.GV3755841@builder \
--to=bjorn.andersson@linaro.org \
--cc=agross@kernel.org \
--cc=colin.king@canonical.com \
--cc=jorge.ramirez-ortiz@linaro.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=khilman@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=niklas.cassel@linaro.org \
--cc=nm@ti.com \
--cc=rafael.j.wysocki@intel.com \
--cc=ulf.hansson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).