From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752394AbbFZIoT (ORCPT ); Fri, 26 Jun 2015 04:44:19 -0400 Received: from terminus.zytor.com ([198.137.202.10]:52136 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751784AbbFZIoQ (ORCPT ); Fri, 26 Jun 2015 04:44:16 -0400 Date: Fri, 26 Jun 2015 01:43:47 -0700 From: tip-bot for Arnaldo Carvalho de Melo Message-ID: Cc: linux-kernel@vger.kernel.org, namhyung@kernel.org, ak@linux.intel.com, hpa@zytor.com, dsahern@gmail.com, tglx@linutronix.de, acme@redhat.com, jolsa@kernel.org, mingo@kernel.org, adrian.hunter@intel.com, a.p.zijlstra@chello.nl, eranian@google.com Reply-To: jolsa@kernel.org, tglx@linutronix.de, acme@redhat.com, dsahern@gmail.com, hpa@zytor.com, eranian@google.com, a.p.zijlstra@chello.nl, adrian.hunter@intel.com, mingo@kernel.org, linux-kernel@vger.kernel.org, ak@linux.intel.com, namhyung@kernel.org In-Reply-To: <20150625174840.GH3253@kernel.org> References: <20150625174840.GH3253@kernel.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/urgent] perf tools: Future-proof thread_map allocation size calculation Git-Commit-ID: 060664f3b9dff37860e48b5158e8429b2467e526 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 060664f3b9dff37860e48b5158e8429b2467e526 Gitweb: http://git.kernel.org/tip/060664f3b9dff37860e48b5158e8429b2467e526 Author: Arnaldo Carvalho de Melo AuthorDate: Thu, 25 Jun 2015 14:48:49 -0300 Committer: Arnaldo Carvalho de Melo CommitDate: Thu, 25 Jun 2015 15:15:49 -0300 perf tools: Future-proof thread_map allocation size calculation Signed-off-by: Jiri Olsa Cc: Adrian Hunter Cc: Andi Kleen Cc: David Ahern Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lkml.kernel.org/r/20150625174840.GH3253@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/thread_map.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/util/thread_map.c b/tools/perf/util/thread_map.c index 8c3c3a0..920136d 100644 --- a/tools/perf/util/thread_map.c +++ b/tools/perf/util/thread_map.c @@ -22,7 +22,7 @@ static int filter(const struct dirent *dir) static struct thread_map *thread_map__realloc(struct thread_map *map, int nr) { - size_t size = sizeof(*map) + sizeof(pid_t) * nr; + size_t size = sizeof(*map) + sizeof(map->map[0]) * nr; return realloc(map, size); }