Hi Varad, On 5 June 2017 at 15:13, Varad Gautam <varad.gau...@collabora.com> wrote: > On Mon, 2017-06-05 at 14:53 +0100, Daniel Stone wrote: >> This above takes a ref, which gets leaked. >> >> struct brw_bo *aux = >> brw_bo_gem_create_from_prime(screen->bufmgr, fds[i], size); >> brw_bo_unreference(aux); >> if (aux != bo) > > Thanks for spotting this. Can the unref(aux) happen before comparing against > bo?
It's safe since it's not dereferenced: we only care about the absolute value of the pointers, not the content of the memory they point to. This was also leaking the fd[0] BO and doing the size calculation twice: would you take https://hastebin.com/xofidugico as a fixup? Cheers, Daniel _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev