[PATCH] tests/intel/xe_vm: Fix assertion on the return value of mmap

Kamil Konieczny kamil.konieczny at linux.intel.com
Thu May 29 12:20:42 UTC 2025


Hi Shuicheng,
On 2025-05-27 at 21:59:15 +0000, Shuicheng Lin wrote:
> The return value of mmap is stored in map, so the assertion should
> use map instead of data.
> 
> Cc: Matthew Brost <matthew.brost at intel.com>
> Cc: Brian Nguyen <brian3.nguyen at intel.com>
> Cc: Alex Zuo <alex.zuo at intel.com>
> Signed-off-by: Shuicheng Lin <shuicheng.lin at intel.com>
> ---
>  tests/intel/xe_vm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/intel/xe_vm.c b/tests/intel/xe_vm.c
> index 5cbd56037..b5bba7b7e 100644
> --- a/tests/intel/xe_vm.c
> +++ b/tests/intel/xe_vm.c
> @@ -1846,7 +1846,7 @@ try_again_after_invalidate:
>  		map = mmap(from_user_pointer(addr), bo_size, PROT_READ |
>  			    PROT_WRITE, MAP_SHARED | MAP_FIXED |
>  			    MAP_ANONYMOUS, -1, 0);
> -		igt_assert(data != MAP_FAILED);
> +		igt_assert(map != MAP_FAILED);

Nice catch!
Reviewed-by: Kamil Konieczny <kamil.konieczny at linux.intel.com>

>  		goto try_again_after_invalidate;
>  	}
>  
> -- 
> 2.25.1
> 


More information about the igt-dev mailing list