diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c index 4a93bf433344d60cf2dc3f7b34e2b12cf3a1befb..9526cf37682e97929839f06b66c9ba07fc5282e6 100644 --- a/tools/perf/util/probe-event.c +++ b/tools/perf/util/probe-event.c @@ -533,7 +533,7 @@ static int get_real_path(const char *raw_path, const char *comp_dir, else { if (access(raw_path, R_OK) == 0) { *new_path = strdup(raw_path); - return 0; + return *new_path ? 0 : -ENOMEM; } else return -errno; }