Skip to content
Snippets Groups Projects
Commit 85fc95d7 authored by Cengiz Can's avatar Cengiz Can Committed by Arnaldo Carvalho de Melo
Browse files

perf maps: Add missing unlock to maps__insert() error case


`tools/perf/util/map.c` has a function named `maps__insert` that
acquires a write lock if its in multithread context.

Even though this lock is released when function successfully completes,
there's a branch that is executed when `maps_by_name == NULL` that
returns from this function without releasing the write lock.

Added an `up_write` to release the lock when this happens.

Fixes: a7c2b572 ("perf map_groups: Auto sort maps by name, if needed")
Signed-off-by: default avatarCengiz Can <cengiz@kernel.wtf>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lore.kernel.org/lkml/20200120141553.23934-1-cengiz@kernel.wtf


Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 1873f154
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment