[Mesa-dev] [PATCH] vl/dri: fix close fd error out
Emil Velikov
emil.l.velikov at gmail.com
Sat May 14 16:10:36 UTC 2016
On 12 May 2016 at 16:19, Leo Liu <leo.liu at amd.com> wrote:
> On 05/12/2016 11:10 AM, Emil Velikov wrote:
>>
>> On 12 May 2016 at 15:10, Leo Liu <leo.liu at amd.com> wrote:
>>>
>>> fd should be set to -1 only if it got closed by pipe_loader_release.
>>>
>>> Signed-off-by: Leo Liu <leo.liu at amd.com>
>>> ---
>>> src/gallium/auxiliary/vl/vl_winsys_dri.c | 5 +++--
>>> 1 file changed, 3 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/src/gallium/auxiliary/vl/vl_winsys_dri.c
>>> b/src/gallium/auxiliary/vl/vl_winsys_dri.c
>>> index 0136526..4636feb 100644
>>> --- a/src/gallium/auxiliary/vl/vl_winsys_dri.c
>>> +++ b/src/gallium/auxiliary/vl/vl_winsys_dri.c
>>> @@ -427,9 +427,10 @@ vl_dri2_screen_create(Display *display, int screen)
>>> return &scrn->base;
>>>
>>> release_pipe:
>>> - if (scrn->base.dev)
>>> + if (scrn->base.dev) {
>>> pipe_loader_release(&scrn->base.dev, 1);
>>> - fd = -1;
>>> + fd = -1;
>>> + }
>>> free_authenticate:
>>> free(authenticate);
>>> close_fd:
>>
>> +if (fd != -1)
>> .... close(fd)
>>
>> Please add a -1 check before the close.
>
>
> Sure I will add it, commit it to the repo later today.
>
In general it would be better to reply with the updated patch first.
Obviously it's not a big deal here.
Thanks again for squashing my silly mistake(s).
Emil
More information about the mesa-dev
mailing list