On Wed, Apr 12, 2017 at 11:33:12PM -0700, Kenneth Graunke wrote:
> I introduced this when cleaning up this code.  libdrm_intel was fine.
> While passing NULL to free() is a common pattern...passing NULL to
> unmap seems pretty bad.

Yup, that was my first thought as well, arriving here with a NULL is a
bad sign. Being internal means you can be much stricter and catch these
errors at source quicker.

> You really ought to know whether you have
> a buffer or not.  So, we could add an assert.  Not sure whether
> that's better.  This takes the defensive plan of bailing early,
> which is what libdrm_intel did originally.
> 
> CID: 1405006

Free free to remove the defensive check, either way:
Reviewed-by: Chris Wilson <ch...@chris-wilson.co.uk>
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to