From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Thomas Richter <tmricht@linux.vnet.ibm.com>
Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
brueckner@linux.vnet.ibm.com, schwidefsky@de.ibm.com,
heiko.carstens@de.ibm.com
Subject: Re: [PATCH] perf s390: Fix reading cpuid model information
Date: Mon, 19 Feb 2018 09:13:35 -0300 [thread overview]
Message-ID: <20180219121335.GB14978@kernel.org> (raw)
In-Reply-To: <20180219102444.96900-1-tmricht@linux.vnet.ibm.com>
Em Mon, Feb 19, 2018 at 11:24:44AM +0100, Thomas Richter escreveu:
> Commit feb3d2d955c8 (perf record: Provide detailed information
> on s390 CPU") fixed a build error on Ubuntu. However the
> fix uses the wrong size to print the model information.
Thanks for the review and quick fix, I'm sorry for letting that slip :-\
sizeof(type) is smaller tha sizeof(model), so at least this would just
limit the formatted model variable to be at most sizeof(type) in lenght.
Anyway, applying the fix :-)
- Arnaldo
> Signed-off-by: Thomas Richter <tmricht@linux.vnet.ibm.com>
> ---
> tools/perf/arch/s390/util/header.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/perf/arch/s390/util/header.c b/tools/perf/arch/s390/util/header.c
> index 231294b80dc4..a4c30f1c70be 100644
> --- a/tools/perf/arch/s390/util/header.c
> +++ b/tools/perf/arch/s390/util/header.c
> @@ -81,7 +81,7 @@ int get_cpuid(char *buffer, size_t sz)
> line2 = line + strlen(SYSINFO_MODEL);
>
> while ((cp = strtok_r(line2, "\n ", &line2))) {
> - mdsize += scnprintf(model + mdsize, sizeof(type) - mdsize,
> + mdsize += scnprintf(model + mdsize, sizeof(model) - mdsize,
> "%s%s", model[0] ? "," : "", cp);
> }
> break;
> --
> 2.14.3
next prev parent reply other threads:[~2018-02-19 12:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-19 10:24 [PATCH] perf s390: Fix reading cpuid model information Thomas Richter
2018-02-19 12:13 ` Arnaldo Carvalho de Melo [this message]
2018-02-21 10:25 ` [tip:perf/core] " tip-bot for Thomas Richter
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=20180219121335.GB14978@kernel.org \
--to=acme@kernel.org \
--cc=brueckner@linux.vnet.ibm.com \
--cc=heiko.carstens@de.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=schwidefsky@de.ibm.com \
--cc=tmricht@linux.vnet.ibm.com \
/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