[PATCH 13/16] drm: Refactor drop/set master code a bit
Emil Velikov
emil.l.velikov at gmail.com
Fri Jun 17 23:47:21 UTC 2016
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>
Thanks
Emil
More information about the dri-devel
mailing list