Hello Alex Hung,

Commit e3d5618d4dad ("drm/amd/display: Test GPU memory allocation")
from Aug 10, 2026 (linux-next), leads to the following Smatch static
checker warning:

        
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/tests/amdgpu_dm_services_test.c:340
 dm_test_gpu_mem_init()
        warn: sizeof(void)

drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/tests/amdgpu_dm_services_test.c
    336 static int dm_test_gpu_mem_init(struct kunit *test)
    337 {
    338         void *cpu_ptr;
    339 
--> 340         cpu_ptr = kunit_kzalloc(test, sizeof(*cpu_ptr), GFP_KERNEL);
                                                     ^^^^^^^^
cpu_ptr is a void pointer.  It doesn't make sense.  Probably remove
the asterisk.

    341         KUNIT_ASSERT_NOT_NULL(test, cpu_ptr);
    342 
    343         dm_test_bo_ctx = (struct dm_test_bo_ops_ctx) {
    344                 .cpu_ptr = cpu_ptr,
    345                 .gpu_addr = DM_TEST_FAKE_GPU_ADDR,
    346         };
    347 
    348         amdgpu_dm_services_kunit_set_ops(&dm_test_bo_ops);
    349 
    350         return 0;
    351 }

This email is a free service from the Smatch-CI project [smatch.sf.net].

regards,
dan carpenter

Reply via email to