From: jsg Date: Thu, 15 Aug 2024 02:51:35 +0000 (+0000) Subject: drm/amdgpu: fix potential resource leak warning X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=6a73d8ccb6c63273447aebbfb7d5041eaf7c091a;p=openbsd drm/amdgpu: fix potential resource leak warning From Tim Huang bc93cfde69b7c786fcdc70463e153fdf633caff9 in linux-6.6.y/6.6.46 22a5daaec0660dd19740c4c6608b78f38760d1e6 in mainline linux --- diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_vm_sdma.c b/sys/dev/pci/drm/amd/amdgpu/amdgpu_vm_sdma.c index 349416e176a..1cf14982046 100644 --- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_vm_sdma.c +++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_vm_sdma.c @@ -102,6 +102,11 @@ static int amdgpu_vm_sdma_prepare(struct amdgpu_vm_update_params *p, if (!r) r = amdgpu_sync_push_to_job(&sync, p->job); amdgpu_sync_free(&sync); + + if (r) { + p->num_dw_left = 0; + amdgpu_job_free(p->job); + } return r; }