throne_tracker: skip iterate if failed to open dir (#1832)

fix https://github.com/tiann/KernelSU/issues/1800
This commit is contained in:
5ec1cff 2024-06-19 09:19:04 +08:00 committed by GitHub
parent f8fb134708
commit f52beb9f75
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -236,13 +236,13 @@ void search_manager(const char *path, int depth, struct list_head *uid_data)
file = ksu_filp_open_compat(pos->dirpath, O_RDONLY | O_NOFOLLOW, 0);
if (IS_ERR(file)) {
pr_err("Failed to open directory: %s, err: %ld\n", pos->dirpath, PTR_ERR(file));
return;
goto skip_iterate;
}
iterate_dir(file, &ctx.ctx);
filp_close(file, NULL);
}
skip_iterate:
list_del(&pos->list);
if (pos != &data)
kfree(pos);