linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
To: ilia.lin@gmail.com
Cc: Ilia Lin <ilialin@codeaurora.org>,
	"Rafael J . Wysocki" <rjw@rjwysocki.net>,
	Dan Carpenter <dan.carpenter@oracle.com>,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] cpufreq: kryo: Fix possible error code dereference
Date: Fri, 15 Jun 2018 08:16:25 +0530	[thread overview]
Message-ID: <20180615024625.rzr4644n77zrtomm@vireshk-i7> (raw)
In-Reply-To: <20180614202921.32535-1-ilia.lin@gmail.com>

On 14-06-18, 22:29, ilia.lin@gmail.com wrote:
> From: Ilia Lin <ilia.lin@gmail.com>
> 
> In event of error returned by the nvmem_cell_read() non-pointer value
> may be dereferenced. Fix this with error handling.
> 
> Signed-off-by: Ilia Lin <ilia.lin@gmail.com>

Fixes tag ?

> ---
>  drivers/cpufreq/qcom-cpufreq-kryo.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/cpufreq/qcom-cpufreq-kryo.c b/drivers/cpufreq/qcom-cpufreq-kryo.c
> index d049fe4b80c4..5e9511223ce9 100644
> --- a/drivers/cpufreq/qcom-cpufreq-kryo.c
> +++ b/drivers/cpufreq/qcom-cpufreq-kryo.c
> @@ -115,6 +115,8 @@ static int qcom_cpufreq_kryo_probe(struct platform_device *pdev)
>  
>  	speedbin = nvmem_cell_read(speedbin_nvmem, &len);
>  	nvmem_cell_put(speedbin_nvmem);
> +	if (IS_ERR(speedbin))
> +		return PTR_ERR(speedbin);
>  
>  	switch (msm8996_version) {
>  	case MSM8996_V3:
> -- 
> 2.11.0

-- 
viresh

  reply	other threads:[~2018-06-15  2:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-14 20:29 [PATCH] cpufreq: kryo: Fix possible error code dereference ilia.lin
2018-06-15  2:46 ` Viresh Kumar [this message]
2018-06-17 19:58 ` [PATCH v2] " ilia.lin
2018-06-18  4:55   ` Viresh Kumar
2018-06-21 13:22     ` 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=20180615024625.rzr4644n77zrtomm@vireshk-i7 \
    --to=viresh.kumar@linaro.org \
    --cc=dan.carpenter@oracle.com \
    --cc=ilia.lin@gmail.com \
    --cc=ilialin@codeaurora.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    /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).