Close shmem file handle, to fix file handle leak
kfdtest hsaKmtOpenKFD failed after 1019 loop if using --gtest_loop=-1, because default max open file handle limit is 1024. Found shmem file handle is not closed from lsof output. Change-Id: I474de2bae6c03e879a219dedf5f18639118b73e5 Signed-off-by: Philip Yang <Philip.Yang@amd.com>
This commit is contained in:
@@ -149,8 +149,11 @@ static void destroy_shared_region(void)
|
||||
if (shared_table && shared_table != MAP_FAILED)
|
||||
munmap(shared_table, sizeof(*shared_table));
|
||||
|
||||
if (shmem_fd > 0)
|
||||
if (shmem_fd > 0) {
|
||||
close(shmem_fd);
|
||||
shm_unlink(shmem_name);
|
||||
}
|
||||
|
||||
if (sem != SEM_FAILED) {
|
||||
sem_close(sem);
|
||||
sem_unlink(sem_name);
|
||||
|
||||
Verwijs in nieuw issue
Block a user