mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-12-29 17:25:38 +00:00
perf trace-event-info: Avoid passing NULL value to closedir
If opendir failed then closedir was passed NULL which is erroneous. Caught by clang-tidy. Signed-off-by: Ian Rogers <irogers@google.com> Acked-by: Namhyung Kim <namhyung@kernel.org> Cc: Ravi Bangoria <ravi.bangoria@amd.com> Cc: Nick Desaulniers <ndesaulniers@google.com> Cc: Yang Jihong <yangjihong1@huawei.com> Cc: Huacai Chen <chenhuacai@kernel.org> Cc: Nathan Chancellor <nathan@kernel.org> Cc: Kan Liang <kan.liang@linux.intel.com> Cc: llvm@lists.linux.dev Cc: Ming Wang <wangming01@loongson.cn> Cc: Tom Rix <trix@redhat.com> Cc: bpf@vger.kernel.org Link: https://lore.kernel.org/r/20231009183920.200859-18-irogers@google.com Signed-off-by: Namhyung Kim <namhyung@kernel.org>
This commit is contained in:
parent
c4b5140c6e
commit
97fe038374
@ -313,7 +313,8 @@ static int record_event_files(struct tracepoint_path *tps)
|
||||
}
|
||||
err = 0;
|
||||
out:
|
||||
closedir(dir);
|
||||
if (dir)
|
||||
closedir(dir);
|
||||
put_tracing_file(path);
|
||||
|
||||
return err;
|
||||
|
Loading…
Reference in New Issue
Block a user