release resources (such as unholding pages) when errors occur. Some
recently added error checks return immediately instead of jumping to a
label resulting in leaks. Fix these to jump to a label to do cleanup
instead.
Reviewed by: kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D3745
if (ctx_id != 0) {
DRM_DEBUG("Ring %s doesn't support contexts\n",
ring->name);
- return -EPERM;
+ ret = -EPERM;
+ goto pre_struct_lock_err;
}
break;
case I915_EXEC_BLT:
if (ctx_id != 0) {
DRM_DEBUG("Ring %s doesn't support contexts\n",
ring->name);
- return -EPERM;
+ ret = -EPERM;
+ goto pre_struct_lock_err;
}
break;
default:
if (!intel_ring_initialized(ring)) {
DRM_DEBUG("execbuf with invalid ring: %d\n",
(int)(args->flags & I915_EXEC_RING_MASK));
- return -EINVAL;
+ ret = -EINVAL;
+ goto pre_struct_lock_err;
}
mode = args->flags & I915_EXEC_CONSTANTS_MASK;