From: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
To: Colin King <colin.king@canonical.com>, Len Brown <len.brown@intel.com>
Cc: Hubert Chrzaniuk <hubert.chrzaniuk@intel.com>,
Dasaratharaman Chandramouli
<dasaratharaman.chandramouli@intel.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] tools/power turbostat: fix overflow read on array slm_freq_table
Date: Mon, 25 Apr 2016 14:00:28 +0200 [thread overview]
Message-ID: <571E06DC.70301@intel.com> (raw)
In-Reply-To: <1461521904-9745-1-git-send-email-colin.king@canonical.com>
On 4/24/2016 8:18 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> When i >= SLM_BCLK_FREQS, the frequency read from the slm_freq_table
> is off the end of the array because msr is set to 3 rather than the
> actual array index i. Set i to 3 rather than msr to fix this.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Can you please CC this to linux-pm@vger.kernel.org? It is easier to
handle then.
> ---
> tools/power/x86/turbostat/turbostat.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c
> index acbf7ff..a66f07c 100644
> --- a/tools/power/x86/turbostat/turbostat.c
> +++ b/tools/power/x86/turbostat/turbostat.c
> @@ -3050,7 +3050,7 @@ double slm_bclk(void)
> i = msr & 0xf;
> if (i >= SLM_BCLK_FREQS) {
> fprintf(outf, "SLM BCLK[%d] invalid\n", i);
> - msr = 3;
> + i = 3;
> }
> freq = slm_freq_table[i];
>
next prev parent reply other threads:[~2016-04-25 12:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-24 18:18 [PATCH] tools/power turbostat: fix overflow read on array slm_freq_table Colin King
2016-04-25 12:00 ` Rafael J. Wysocki [this message]
-- strict thread matches above, loose matches on Subject: below --
2016-04-25 12:03 Colin King
2016-06-16 5:36 ` Len Brown
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=571E06DC.70301@intel.com \
--to=rafael.j.wysocki@intel.com \
--cc=colin.king@canonical.com \
--cc=dasaratharaman.chandramouli@intel.com \
--cc=hubert.chrzaniuk@intel.com \
--cc=len.brown@intel.com \
--cc=linux-kernel@vger.kernel.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 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.