On 2018-06-25 04:15 AM, Zhang, Jerry (Junwei) wrote: > On 06/23/2018 12:42 AM, Michel Dänzer wrote: >> From: Michel Dänzer <michel.daenzer at amd.com> >> >> Without this, there could not be enough slots, which could trigger the >> BUG_ON in reservation_object_add_shared_fence. >> >> Cc: stable at vger.kernel.org >> Bugzilla: https://bugs.freedesktop.org/106418 >> Reported-by: mikhail.v.gavrilov at gmail.com >> Signed-off-by: Michel Dänzer <michel.daenzer at amd.com> >> --- >>  drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 4 ++++ >>  1 file changed, 4 insertions(+) >> >> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c >> b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c >> index 590db78b8c72..75579200f4a6 100644 >> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c >> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c >> @@ -1111,6 +1111,10 @@ int amdgpu_vm_update_directories(struct >> amdgpu_device *adev, >>          struct amdgpu_ring *ring; >>          struct dma_fence *fence; >> >> +       r = reservation_object_reserve_shared(root->tbo.resv); >> +       if (r) >> +           return r; > > Good catch. > > But we may "goto error" here to do some cleanup. Indeed, thanks, fixed in v2. -- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer