intel: Don't leak the test page in an has_userptr() error path

When handling the error on GEM_CLOSE, we weren't freeing the allocated
page. Plug that.

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
main
Damien Lespiau 2014-09-17 13:33:45 +01:00
parent 0fa1dbf646
commit 77dce9a012
1 changed files with 2 additions and 3 deletions

View File

@ -3403,9 +3403,8 @@ retry:
close_bo.handle = userptr.handle;
ret = drmIoctl(bufmgr_gem->fd, DRM_IOCTL_GEM_CLOSE, &close_bo);
if (ret == 0) {
free(ptr);
} else {
free(ptr);
if (ret) {
fprintf(stderr, "Failed to release test userptr object! (%d) "
"i915 kernel driver may not be sane!\n", errno);
return false;