From f903d01cf2ace79ec2f9a046e8072d0095b4928b Mon Sep 17 00:00:00 2001 From: hunt Date: Mon, 16 Jan 2006 08:33:35 +0000 Subject: 2006-01-16 Martin Hunt * map.c (_stp_pmap_agg): Return NULL when aggregation fails. --- runtime/map.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'runtime/map.c') 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); -- cgit