From: Arnaldo Carvalho de Melo Date: Wed, 3 Jun 2009 17:49:21 +0000 (-0300) Subject: perf_counter tools: Fix off-by-one bug in symbol__new X-Git-Tag: v2.6.31-rc1~383^2~93 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=18374ab76e3ec1cf1b0ca5a8d08e35cfc5d01669;p=~emulex%2Finfiniband.git perf_counter tools: Fix off-by-one bug in symbol__new The end is really (start + len - 1). Noticed when synthesizing the PLT symbols, that are small (16 bytes), and hot on the start RIP. Signed-off-by: Arnaldo Carvalho de Melo Cc: Peter Zijlstra Cc: Mike Galbraith Cc: Paul Mackerras Cc: Corey Ashford Cc: Marcelo Tosatti Cc: Arnaldo Carvalho de Melo Cc: Thomas Gleixner LKML-Reference: <20090603174921.GG7805@ghostprotocols.net> Signed-off-by: Ingo Molnar --- diff --git a/Documentation/perf_counter/util/symbol.c b/Documentation/perf_counter/util/symbol.c index d52a1ae5342..35ee6de1e51 100644 --- a/Documentation/perf_counter/util/symbol.c +++ b/Documentation/perf_counter/util/symbol.c @@ -19,7 +19,7 @@ static struct symbol *symbol__new(uint64_t start, uint64_t len, self = ((void *)self) + priv_size; } self->start = start; - self->end = start + len; + self->end = start + len - 1; memcpy(self->name, name, namelen); }