summaryrefslogtreecommitdiff
path: root/amdgpu
diff options
context:
space:
mode:
authorTom St Denis <tom.stdenis@amd.com>2015-10-09 12:07:26 -0400
committerAlex Deucher <alexander.deucher@amd.com>2015-10-22 12:36:38 -0400
commit1a6a8f34a0b17ac03f42bac416e5d289f9c3248f (patch)
tree63c5af3cc14e1a5fdf93e18861dfe0b95ff612c1 /amdgpu
parent988f31ecc29770a2648bf5c7d7779f1e500c196c (diff)
downloadlibdrm-1a6a8f34a0b17ac03f42bac416e5d289f9c3248f.tar.gz
libdrm-1a6a8f34a0b17ac03f42bac416e5d289f9c3248f.tar.bz2
libdrm-1a6a8f34a0b17ac03f42bac416e5d289f9c3248f.zip
amdgpu: Fix use-after-free bug in vamgr_deinit
This patch fixes a use-after-free bug in the vamgr_deinit function. Signed-off-by: Tom St Denis <tom.stdenis@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'amdgpu')
-rw-r--r--amdgpu/amdgpu_vamgr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/amdgpu/amdgpu_vamgr.c b/amdgpu/amdgpu_vamgr.c
index 2221da03..8a707cbc 100644
--- a/amdgpu/amdgpu_vamgr.c
+++ b/amdgpu/amdgpu_vamgr.c
@@ -57,8 +57,8 @@ drm_private void amdgpu_vamgr_init(struct amdgpu_bo_va_mgr *mgr, uint64_t start,
drm_private void amdgpu_vamgr_deinit(struct amdgpu_bo_va_mgr *mgr)
{
- struct amdgpu_bo_va_hole *hole;
- LIST_FOR_EACH_ENTRY(hole, &mgr->va_holes, list) {
+ struct amdgpu_bo_va_hole *hole, *tmp;
+ LIST_FOR_EACH_ENTRY_SAFE(hole, tmp, &mgr->va_holes, list) {
list_del(&hole->list);
free(hole);
}