[PATCH 13/16] drm: Refactor drop/set master code a bit
Daniel Vetter
daniel at ffwll.ch
Mon Jun 20 21:07:35 UTC 2016
On Sat, Jun 18, 2016 at 12:47:21AM +0100, Emil Velikov wrote:
> On 18 June 2016 at 00:00, Emil Velikov <emil.l.velikov at gmail.com> wrote:
>
> >> @@ -134,24 +152,21 @@ static int drm_new_set_master(struct drm_device *dev, struct drm_file *fpriv)
> >>
> >> /* take another reference for the copy in the local file priv */
> >> old_master = fpriv->master;
> >> - fpriv->master = drm_master_get(dev->master);
> >> + fpriv->master = drm_master_create(dev);
> To avoid the leak just drop the fpriv->minor->dev->master =
> drm_master_create() a few lines above (+ the associated comment/error
> handling drm_master_put(fpriv->minor->dev->master))
>
> >> + if (!fpriv->master)
> >> + return -ENOMEM;
> >>
> ... and restore the old_master before the return "fpriv->master = old_master;"
>
> With that and the other minor comments the series is
> Reviewed-by: Emil Velikov <emil.l.velikov at gmail.com>
This one is a real mess, I've redone it but don't feel like I can just add
your r-b. I'll resend again.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
More information about the dri-devel
mailing list