[bug report] drm/amdgpu: add selftest framework for UMSCH

Lang Yu Lang.Yu at amd.com
Wed Sep 6 11:07:32 UTC 2023


On 09/06/ , Dan Carpenter wrote:

Thanks for reporting this bug. Can you give a link to this bug report? Commit message requests it.
("Reported-by: should be immediately followed by Link: with a URL to the report")

Regards,
Lang

> Hello Lang Yu,
> 
> The patch 5d5eac7e8303: "drm/amdgpu: add selftest framework for
> UMSCH" from Jun 21, 2023 (linux-next), leads to the following Smatch
> static checker warning:
> 
> 	drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.c:338 setup_umsch_mm_test()
> 	warn: unsigned error codes 'test->pasid'
> 
> drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.c
>     319 static int setup_umsch_mm_test(struct amdgpu_device *adev,
>     320                           struct umsch_mm_test *test)
>     321 {
>     322         struct amdgpu_vmhub *hub = &adev->vmhub[AMDGPU_MMHUB0(0)];
>     323         int r;
>     324 
>     325         test->vm_cntx_cntl = hub->vm_cntx_cntl;
>     326 
>     327         test->vm = kzalloc(sizeof(*test->vm), GFP_KERNEL);
>     328         if (!test->vm) {
>     329                 r = -ENOMEM;
>     330                 return r;
>     331         }
>     332 
>     333         r = amdgpu_vm_init(adev, test->vm, -1);
>     334         if (r)
>     335                 goto error_free_vm;
>     336 
>     337         test->pasid = amdgpu_pasid_alloc(16);
> --> 338         if (test->pasid < 0) {
>                     ^^^^^^^^^^^^^^^
> Unsigned can't be less than zero.
> 
>     339                 r = test->pasid;
>     340                 goto error_fini_vm;
>     341         }
>     342 
>     343         r = amdgpu_bo_create_kernel(adev, sizeof(struct umsch_mm_test_ctx_data),
> 
> regards,
> dan carpenter


More information about the amd-gfx mailing list