Commit 6b61a54
drm/amdgpu: Fix double deletion of validate_list
If amdgpu_amdkfd_gpuvm_free_memory_of_gpu() fails after kgd_mem is
removed from validate_list, the mem handle still lingers in the KFD idr.
This means when process is terminated,
kfd_process_free_outstanding_kfd_bos() will call
amdgpu_amdkfd_gpuvm_free_memory_of_gpu() again resulting in double
deletion.
To avoid this -
(a) Check if list is empty before deleting it
(b) Rearragne amdgpu_amdkfd_gpuvm_free_memory_of_gpu() such that it can
be safely called again if it returns failure the first time.
Signed-off-by: Harish Kasiviswanathan <[email protected]>
Reviewed-by: Philip Yang <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
(cherry picked from commit 6ba6034)1 parent 8496244 commit 6b61a54
1 file changed
Lines changed: 7 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1920 | 1920 | | |
1921 | 1921 | | |
1922 | 1922 | | |
1923 | | - | |
| 1923 | + | |
| 1924 | + | |
1924 | 1925 | | |
1925 | 1926 | | |
| 1927 | + | |
| 1928 | + | |
| 1929 | + | |
| 1930 | + | |
1926 | 1931 | | |
1927 | 1932 | | |
1928 | 1933 | | |
1929 | | - | |
1930 | 1934 | | |
1931 | | - | |
| 1935 | + | |
1932 | 1936 | | |
1933 | 1937 | | |
1934 | | - | |
1935 | | - | |
1936 | | - | |
1937 | | - | |
1938 | 1938 | | |
1939 | 1939 | | |
1940 | 1940 | | |
| |||
0 commit comments