projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
68e94f4
)
Account the nr_entries in rblist properly
author
Suzuki K. Poulose
<
[email protected]
>
Fri, 31 Aug 2012 07:09:18 +0000
(12:39 +0530)
committer
Arnaldo Carvalho de Melo
<
[email protected]
>
Wed, 24 Oct 2012 16:20:11 +0000
(14:20 -0200)
The nr_entries in rblist is never decremented when an element
is deleted. Also, use rblist__remove_node to delete a node in
rblist__delete(). This would keep the nr_entries sane.
Signed-off-by: Suzuki K. Poulose <
[email protected]
>
Acked-by: David S. Ahern <
[email protected]
>
Cc: David S. Ahern <
[email protected]
>
Link:
http://lkml.kernel.org/r/
[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <
[email protected]
>
tools/perf/util/rblist.c
patch
|
blob
|
history
diff --git
a/tools/perf/util/rblist.c
b/tools/perf/util/rblist.c
index 0171fb611004ec16c40da435d4ee0cac44be22b3..a16cdd2625ad2b4a0ff8ff39d6b91b331f3a3a1e 100644
(file)
--- a/
tools/perf/util/rblist.c
+++ b/
tools/perf/util/rblist.c
@@
-44,6
+44,7
@@
int rblist__add_node(struct rblist *rblist, const void *new_entry)
void rblist__remove_node(struct rblist *rblist, struct rb_node *rb_node)
{
rb_erase(rb_node, &rblist->entries);
+ --rblist->nr_entries;
rblist->node_delete(rblist, rb_node);
}
@@
-87,8
+88,7
@@
void rblist__delete(struct rblist *rblist)
while (next) {
pos = next;
next = rb_next(pos);
- rb_erase(pos, &rblist->entries);
- rblist->node_delete(rblist, pos);
+ rblist__remove_node(rblist, pos);
}
free(rblist);
}