Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

perf unwind-libunwind: Add malloc() failure handling

Add malloc() failure handling in unread_unwind_spec_debug_frame().
This make caller find_proc_info() works well when the allocation failure.

Signed-off-by: Yunseong Kim <yskelg@gmail.com>
Reviewed-by: Ian Rogers <irogers@google.com>
Cc: Ravi Bangoria <ravi.bangoria@amd.com>
Cc: Austin Kim <austindh.kim@gmail.com>
Cc: shjy180909@gmail.com
Cc: Ze Gao <zegao2021@gmail.com>
Cc: Leo Yan <leo.yan@linux.dev>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/r/20240619204211.6438-2-yskelg@gmail.com

authored by

Yunseong Kim and committed by
Namhyung Kim
83da316a e9ffa312

+5
+5
tools/perf/util/unwind-libunwind-local.c
··· 390 390 char *debuglink = malloc(PATH_MAX); 391 391 int ret = 0; 392 392 393 + if (debuglink == NULL) { 394 + pr_err("unwind: Can't read unwind spec debug frame.\n"); 395 + return -ENOMEM; 396 + } 397 + 393 398 ret = dso__read_binary_type_filename( 394 399 dso, DSO_BINARY_TYPE__DEBUGLINK, 395 400 machine->root_dir, debuglink, PATH_MAX);