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
parent
0fa1dbf646
commit
77dce9a012
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue