[PATCH 1/7] tests/amdgpu: Fix valgrind warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Struct access after free

Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@xxxxxxx>
---
 tests/amdgpu/basic_tests.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tests/amdgpu/basic_tests.c b/tests/amdgpu/basic_tests.c
index 8e7c4916..8b7fd0f6 100644
--- a/tests/amdgpu/basic_tests.c
+++ b/tests/amdgpu/basic_tests.c
@@ -626,13 +626,14 @@ CU_BOOL suite_basic_tests_enable(void)
 					     &minor_version, &device_handle))
 		return CU_FALSE;
 
-	if (amdgpu_device_deinitialize(device_handle))
-		return CU_FALSE;
 
 	family_id = device_handle->info.family_id;
 	chip_id = device_handle->info.chip_external_rev;
 	chip_rev = device_handle->info.chip_rev;
 
+	if (amdgpu_device_deinitialize(device_handle))
+		return CU_FALSE;
+
 	/* disable gfx engine basic test cases for some asics have no CPG */
 	if (asic_is_gfx_pipe_removed(family_id, chip_id, chip_rev)) {
 		if (amdgpu_set_test_active("Basic Tests",
-- 
2.25.1




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux