drm: fix blob pointer check

David Herrmann dh.herrmann at gmail.com
Fri Mar 11 12:01:46 UTC 2016


Hey

On Fri, Mar 11, 2016 at 12:52 PM, Lionel Landwerlin
<lionel.g.landwerlin at intel.com> wrote:
> Thanks a lot for pointing this out. I saw you previous comment but didn't
> realize the issue.
> I'll set the pointer to NULL.
>
> I don't if there is an agreement on this, but do you think the unref/free
> functions should check for error pointers?

This is what we did so far, and I'd recommend keeping it for now:

        r = PTR_ERR(foobar);
        foobar = NULL;
        goto error;

As an option, stop overloading pointers and return them like everyone
else does: as a double-pointer in an output argument. This ERR_PTR()
craziness needs to stop.

David


More information about the dri-devel mailing list