core: Prepare cus__find_cu_by_name() for locking

By having just one exit point.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
Arnaldo Carvalho de Melo 2021-06-22 10:32:59 -03:00
parent 4bf7285b37
commit 7020f92143
1 changed files with 4 additions and 2 deletions

View File

@ -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)