Commit 92717bc0 authored by James Clark's avatar James Clark Committed by Namhyung Kim

perf dso: Fix build when libunwind is enabled

Now that symsrc_filename is always accessed through an accessor, we also
need a free() function for it to avoid the following compilation error:

  util/unwind-libunwind-local.c:416:12: error: lvalue required as unary
    ‘&’ operand
  416 |      zfree(&dso__symsrc_filename(dso));

Fixes: 1553419c ("perf dso: Fix address sanitizer build")
Signed-off-by: default avatarJames Clark <james.clark@linaro.org>
Reviewed-by: default avatarIan Rogers <irogers@google.com>
Tested-by: default avatarLeo Yan <leo.yan@arm.com>
Tested-by: default avatarFlorian Fainelli <florian.fainelli@broadcom.com>
Cc: Yunseong Kim <yskelg@gmail.com>
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
Link: https://lore.kernel.org/r/20240715094715.3914813-1-james.clark@linaro.orgSigned-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
parent 2085948e
...@@ -1501,7 +1501,7 @@ void dso__delete(struct dso *dso) ...@@ -1501,7 +1501,7 @@ void dso__delete(struct dso *dso)
auxtrace_cache__free(RC_CHK_ACCESS(dso)->auxtrace_cache); auxtrace_cache__free(RC_CHK_ACCESS(dso)->auxtrace_cache);
dso_cache__free(dso); dso_cache__free(dso);
dso__free_a2l(dso); dso__free_a2l(dso);
zfree(&RC_CHK_ACCESS(dso)->symsrc_filename); dso__free_symsrc_filename(dso);
nsinfo__zput(RC_CHK_ACCESS(dso)->nsinfo); nsinfo__zput(RC_CHK_ACCESS(dso)->nsinfo);
mutex_destroy(dso__lock(dso)); mutex_destroy(dso__lock(dso));
RC_CHK_FREE(dso); RC_CHK_FREE(dso);
......
...@@ -602,6 +602,11 @@ static inline void dso__set_symsrc_filename(struct dso *dso, char *val) ...@@ -602,6 +602,11 @@ static inline void dso__set_symsrc_filename(struct dso *dso, char *val)
RC_CHK_ACCESS(dso)->symsrc_filename = val; RC_CHK_ACCESS(dso)->symsrc_filename = val;
} }
static inline void dso__free_symsrc_filename(struct dso *dso)
{
zfree(&RC_CHK_ACCESS(dso)->symsrc_filename);
}
static inline enum dso_binary_type dso__symtab_type(const struct dso *dso) static inline enum dso_binary_type dso__symtab_type(const struct dso *dso)
{ {
return RC_CHK_ACCESS(dso)->symtab_type; return RC_CHK_ACCESS(dso)->symtab_type;
......
...@@ -413,7 +413,7 @@ static int read_unwind_spec_debug_frame(struct dso *dso, ...@@ -413,7 +413,7 @@ static int read_unwind_spec_debug_frame(struct dso *dso,
__func__, __func__,
dso__symsrc_filename(dso), dso__symsrc_filename(dso),
debuglink); debuglink);
zfree(&dso__symsrc_filename(dso)); dso__free_symsrc_filename(dso);
} }
dso__set_symsrc_filename(dso, debuglink); dso__set_symsrc_filename(dso, debuglink);
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment