From: Thomas Richter Date: Mon, 19 Feb 2018 10:24:44 +0000 (+0100) Subject: perf s390: Fix reading cpuid model information X-Git-Tag: v4.19~1357^2~42^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=47812e00910407a0f14906c0a3bf2d803a616c6f;p=platform%2Fkernel%2Flinux-rpi.git perf s390: Fix reading cpuid model information Commit eca0fa28cd0d (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. Signed-off-by: Thomas Richter Cc: Heiko Carstens Cc: Hendrik Brueckner Cc: Martin Schwidefsky Fixes: eca0fa28cd0d ("perf record: Provide detailed information on s390 CPU") Link: http://lkml.kernel.org/r/20180219102444.96900-1-tmricht@linux.vnet.ibm.com Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/arch/s390/util/header.c b/tools/perf/arch/s390/util/header.c index 231294b..a4c30f1 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;