[PATCH] drm/gem: use new idr deletion interface to cleanup drm_gem_handle_delete()

Aishwarya Pant aishpant at gmail.com
Tue Sep 26 09:20:32 UTC 2017


On Tue, Sep 26, 2017 at 10:12:12AM +0100, Chris Wilson wrote:
> Quoting Aishwarya Pant (2017-09-25 19:47:28)
> > The IDR deletion interface now returns the deleted entry or NULL if it was not
> > present. So we don't have to do the extra work of checking if we have a
> > reference on the drm_gem_object, this can be handled by checking the return
> > value from idr_remove() and the extra locks can be dropped.
> > 
> > Signed-off-by: Aishwarya Pant <aishpant at gmail.com>
> 
> This reintroduces the bug were the idr entry is available for reuse
> before the drivers have had the change to release their resources. So a
> new handle may be reused that is then hooked up to the old private data.
> See commit f6cd7daecff558fab2c45d15283d3e52f688342d
> Author: Chris Wilson <chris at chris-wilson.co.uk>
> Date:   Fri Apr 15 12:55:08 2016 +0100
> 
>     drm: Release driver references to handle before making it available again

Thanks, this makes sense now.

> -Chris


More information about the dri-devel mailing list