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:
parent
4bf7285b37
commit
7020f92143
|
@ -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)
|
list_for_each_entry(pos, &cus->cus, node)
|
||||||
if (pos->name && strcmp(pos->name, name) == 0)
|
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)
|
struct tag *cu__find_function_by_name(const struct cu *cu, const char *name)
|
||||||
|
|
Loading…
Reference in New Issue