Re: [PATCH 13/16] drm: Refactor drop/set master code a bit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 18 June 2016 at 00:00, Emil Velikov <emil.l.velikov@xxxxxxxxx> 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@xxxxxxxxx>

Thanks
Emil
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux