소스 검색

drm/qxl: Avoid double free on error

Is we are not able to get source bo object from handle we free
destination bo object and call cleanup code however destination
object was already inserted in reloc_info array (num_relocs was
already incremented) so on cleanup we free destination again.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Frediano Ziglio 10 년 전
부모
커밋
fe2af53bae
1개의 변경된 파일0개의 추가작업 그리고 2개의 파일을 삭제
  1. 0 2
      drivers/gpu/drm/qxl/qxl_ioctl.c

+ 0 - 2
drivers/gpu/drm/qxl/qxl_ioctl.c

@@ -240,8 +240,6 @@ static int qxl_process_single_command(struct qxl_device *qdev,
 				qxlhw_handle_to_bo(qdev, file_priv,
 				qxlhw_handle_to_bo(qdev, file_priv,
 						   reloc.src_handle, release);
 						   reloc.src_handle, release);
 			if (!reloc_info[i].src_bo) {
 			if (!reloc_info[i].src_bo) {
-				if (reloc_info[i].dst_bo != cmd_bo)
-					drm_gem_object_unreference_unlocked(&reloc_info[i].dst_bo->gem_base);
 				ret = -EINVAL;
 				ret = -EINVAL;
 				goto out_free_bos;
 				goto out_free_bos;
 			}
 			}