Re: [PATCH libdrm 2/3] amdgpu: don't mess with shared_handle if amdgpu_bo_import() fails

2017-01-23 Thread Emil Velikov
On 23 January 2017 at 16:14, Nicolai Hähnle wrote: > I don't think is correct. The incoming handle is in shared_handle, not in > handle. Once the code block around line 310 has executed, shared_handle is > the handle produced by drmPrimeFDToHandle, and closing it on error (as

Re: [PATCH libdrm 2/3] amdgpu: don't mess with shared_handle if amdgpu_bo_import() fails

2017-01-23 Thread Nicolai Hähnle
I don't think is correct. The incoming handle is in shared_handle, not in handle. Once the code block around line 310 has executed, shared_handle is the handle produced by drmPrimeFDToHandle, and closing it on error (as the code currently does) should be the correct thing to do. The only

[PATCH libdrm 2/3] amdgpu: don't mess with shared_handle if amdgpu_bo_import() fails

2017-01-22 Thread Emil Velikov
Do not close the handle if someone else has created it. Afaict there's no change of ownership implied if the function fails. Thus the caller is responsible to doing the right thing - trying again, closing the handle and/or other. Cc: amd-...@lists.freedesktop.org Signed-off-by: Emil Velikov