[PATCH tip 1/1] perf_counter tools: Fix off-by-one bug insymbol__new

From: Arnaldo Carvalho de Melo
Date: Wed Jun 03 2009 - 13:49:54 EST


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 <acme@xxxxxxxxxx>

diff --git a/Documentation/perf_counter/util/symbol.c b/Documentation/perf_counter/util/symbol.c
index d52a1ae..35ee6de 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);
}

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/