diff options
-rw-r--r-- | runtime/ChangeLog | 5 | ||||
-rw-r--r-- | runtime/map.c | 10 |
2 files changed, 12 insertions, 3 deletions
diff --git a/runtime/ChangeLog b/runtime/ChangeLog index d3bf202a..159bb484 100644 --- a/runtime/ChangeLog +++ b/runtime/ChangeLog @@ -1,3 +1,8 @@ +2006-01-16 Martin Hunt <hunt@redhat.com> + + * map.c (_stp_pmap_agg): Return NULL when aggregation + fails. + 2006-01-15 Frank Ch. Eigler <fche@elastic.org> * io.c (_stp_exit): Revert. diff --git a/runtime/map.c b/runtime/map.c index 1d6d084e..1e9fd62a 100644 --- a/runtime/map.c +++ b/runtime/map.c @@ -850,7 +850,7 @@ static void _stp_add_agg(struct map_node *aptr, struct map_node *ptr) * A write lock must be held on the map during this function. * * @param map A pointer to a pmap. - * @returns a pointer to an aggregated map. + * @returns a pointer to the aggregated map. Null on failure. */ MAP _stp_pmap_agg (PMAP pmap) { @@ -885,8 +885,12 @@ MAP _stp_pmap_agg (PMAP pmap) } if (match) _stp_add_agg(aptr, ptr); - else - _stp_new_agg(agg, ahead, ptr); + else { + if (!_stp_new_agg(agg, ahead, ptr)) { + spin_unlock(&m->lock); + return NULL; + } + } } } spin_unlock(&m->lock); |