ctx.src_fds[2] = ctx.src_fds[0];
bo_dst = tbm_surface_internal_get_bo(buffer->dst, 0);
- RETURN_VAL_IF_FAIL(bo_dst != NULL, TDM_ERROR_OPERATION_FAILED);
+ if (bo_dst == NULL) {
+ close(ctx.src_fds[0]);
+ return TDM_ERROR_OPERATION_FAILED;
+ }
handle_dst = (__u32)tbm_bo_get_handle(bo_dst, TBM_DEVICE_DEFAULT).u32;
ctx.dst_fds[0] = _tdm_gem_to_dmafd(drm_fd, handle_dst);
+ if (ctx.dst_fds[0] < 0) {
+ close(ctx.src_fds[0]);
+ return TDM_ERROR_OPERATION_FAILED;
+ }
+
ctx.dst_fds[1] = ctx.dst_fds[0];
ctx.dst_fds[2] = ctx.dst_fds[0];