On 21 January 2017 at 11:07, walter harms <[email protected]> wrote:

>>>> +    if (fetch_deviceinfo) {
>>>> +        ptr += sizeof(drmHost1xBusInfo);
>>>> +        dev->deviceinfo.host1x = (drmHost1xDeviceInfoPtr)ptr;
>>>> +
>>>> +        ret = drmParseHost1xDeviceInfo(maj, min, dev->deviceinfo.host1x);
>>>> +        if (ret < 0)
>>>> +            goto free_device;
>>>> +    }
>>>> +
>>>> +    *device = dev;
>>>> +
>>>
>>> do you assume that fetch_deviceinfo may change dev ?
>>
>> No, why?
>
> You do *device = dev; after the if block that leaves the impression (for me)
> that dev may change somewhere. therefor i would suggest moving this upwards.
>
Suspecting that you're missing the "Thou Shalt Not overwrite any
output variables on error."

Thus having *device = dev just before "return success" is what you want to do.

-Emil
_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to