Re: [PATCH] drm: manage drm_minor cleanup with drmm_

2020-03-25 Thread Daniel Vetter
On Tue, Mar 24, 2020 at 10:42 PM Sam Ravnborg wrote: > > On Tue, Mar 24, 2020 at 09:39:36PM +0100, Daniel Vetter wrote: > > The cleanup here is somewhat tricky, since we can't tell apart the > > allocated minor index from 0. So register a cleanup action first, and > > if the index allocation fails

Re: [PATCH] drm: manage drm_minor cleanup with drmm_

2020-03-24 Thread Sam Ravnborg
On Tue, Mar 24, 2020 at 09:39:36PM +0100, Daniel Vetter wrote: > The cleanup here is somewhat tricky, since we can't tell apart the > allocated minor index from 0. So register a cleanup action first, and > if the index allocation fails, unregister that cleanup action again to > avoid bad mistakes.

[PATCH] drm: manage drm_minor cleanup with drmm_

2020-03-24 Thread Daniel Vetter
The cleanup here is somewhat tricky, since we can't tell apart the allocated minor index from 0. So register a cleanup action first, and if the index allocation fails, unregister that cleanup action again to avoid bad mistakes. The kdev for the minor already handles NULL, so no problem there. Hen