Messages in this thread Patch in this message | | | From | Namhyung Kim <> | Subject | [PATCH 1/9] perf srcline: Do not return NULL for srcline | Date | Thu, 15 Dec 2022 11:28:09 -0800 |
| |
The code assumes non-NULL srcline value always, let's return the usual SRCLINE_UNKNOWN ("??:0") string instead.
Signed-off-by: Namhyung Kim <namhyung@kernel.org> --- tools/perf/util/srcline.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/util/srcline.c b/tools/perf/util/srcline.c index af468e3bb6fa..5319efb16a5a 100644 --- a/tools/perf/util/srcline.c +++ b/tools/perf/util/srcline.c @@ -716,7 +716,7 @@ char *__get_srcline(struct dso *dso, u64 addr, struct symbol *sym, if (!show_addr) return (show_sym && sym) ? - strndup(sym->name, sym->namelen) : NULL; + strndup(sym->name, sym->namelen) : SRCLINE_UNKNOWN; if (sym) { if (asprintf(&srcline, "%s+%" PRIu64, show_sym ? sym->name : "", -- 2.39.0.314.g84b9a713c41-goog
| |