Skip to content

Commit 300a901

Browse files
Lijo Lazargregkh
authored andcommitted
drm/amdgpu/vcn: Fix double-free of vcn dump buffer
commit 1a0e57e upstream. The buffer is already freed as part of amdgpu_vcn_reg_dump_fini(). The issue is introduced by below patch series. Fixes: de55cbf ("drm/amdgpu/vcn: Add regdump helper functions") Signed-off-by: Lijo Lazar <[email protected]> Reviewed-by: Sathishkumar S <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 3bd9391 commit 300a901

File tree

4 files changed

+1
-5
lines changed

4 files changed

+1
-5
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1573,6 +1573,7 @@ int amdgpu_vcn_reg_dump_init(struct amdgpu_device *adev,
15731573
static void amdgpu_vcn_reg_dump_fini(struct amdgpu_device *adev)
15741574
{
15751575
kfree(adev->vcn.ip_dump);
1576+
adev->vcn.ip_dump = NULL;
15761577
adev->vcn.reg_list = NULL;
15771578
adev->vcn.reg_count = 0;
15781579
}

drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,6 @@ static int vcn_v3_0_sw_fini(struct amdgpu_ip_block *ip_block)
361361
return r;
362362
}
363363

364-
kfree(adev->vcn.ip_dump);
365364
return 0;
366365
}
367366

drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,6 @@ static int vcn_v4_0_3_sw_fini(struct amdgpu_ip_block *ip_block)
287287
return r;
288288
}
289289

290-
kfree(adev->vcn.ip_dump);
291-
292290
return 0;
293291
}
294292

drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,6 @@ static int vcn_v4_0_5_sw_fini(struct amdgpu_ip_block *ip_block)
284284
return r;
285285
}
286286

287-
kfree(adev->vcn.ip_dump);
288-
289287
return 0;
290288
}
291289

0 commit comments

Comments
 (0)