From 7020f9214328ac8da9357b322f6cc58e9d30b3d7 Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Tue, 22 Jun 2021 10:32:59 -0300 Subject: [PATCH] core: Prepare cus__find_cu_by_name() for locking By having just one exit point. Signed-off-by: Arnaldo Carvalho de Melo --- dwarves.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dwarves.c b/dwarves.c index 3a658b3..97e42f1 100644 --- a/dwarves.c +++ b/dwarves.c @@ -984,9 +984,11 @@ struct cu *cus__find_cu_by_name(const struct cus *cus, const char *name) list_for_each_entry(pos, &cus->cus, node) if (pos->name && strcmp(pos->name, name) == 0) - return pos; + goto out; - return NULL; + pos = NULL; +out: + return pos; } struct tag *cu__find_function_by_name(const struct cu *cu, const char *name)