]> sourceware.org Git - systemtap.git/commitdiff
PR14682: fix _stp_pmap_agg error exit path
authorFrank Ch. Eigler <fche@redhat.com>
Mon, 8 Oct 2012 00:01:37 +0000 (20:01 -0400)
committerFrank Ch. Eigler <fche@redhat.com>
Mon, 8 Oct 2012 00:01:37 +0000 (20:01 -0400)
commit 82523f19 changed the error-exit path of _stp_pmap_agg, but was
confused by the multiple (three!) levels of nested loops in effect at
the point of failure.  While the prior "return;" skipped an overall
(newly needed) aggregate-unlock; the current "break;" skipped too
little.  Switch to a proper simple goto to almost but not quite
return;.

runtime/map.c

index b0c7d43bed7076afbc93a50ef0e00109ebebb5f5..c9cf029e4e9a86f51911da0519620a32e77b1734 100644 (file)
@@ -887,17 +887,19 @@ static MAP _stp_pmap_agg (PMAP pmap)
                                        _stp_add_agg(aptr, ptr);
                                else {
                                        if (!_stp_new_agg(agg, ahead, ptr)) {
-                                               quit = 1;
-                                               agg = NULL;
-                                               break;
+                                                MAP_UNLOCK(m);
+                                                agg = NULL;
+                                               goto out;
+                                                // NB: break would head out to the for (hash...) 
+                                                // loop, which behaves badly with an agg==NULL.
                                        }
                                }
                        }
                }
                MAP_UNLOCK(m);
-               if (quit)
-                       break;
        }
+
+        out:
 #ifndef __KERNEL__
        TLS_DATA_CONTAINER_UNLOCK(&pmap->container);
 #endif
This page took 0.029442 seconds and 5 git commands to generate.