]> git.baikalelectronics.ru Git - kernel.git/commit
drm/amdkfd: Fix UBSAN shift-out-of-bounds warning
authorFelix Kuehling <Felix.Kuehling@amd.com>
Wed, 21 Sep 2022 21:45:59 +0000 (17:45 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 30 Sep 2022 15:21:25 +0000 (11:21 -0400)
commitc73bf60d8f89379aaa38a4e7bb2a46a2ef812027
treef9dff8785fcb8d2b4590086da31a608316628c70
parente68f86a760bfed42490b474c13d8e0fa7d13c9e1
drm/amdkfd: Fix UBSAN shift-out-of-bounds warning

This was fixed in initialize_cpsch before, but not in initialize_nocpsch.
Factor sdma bitmap initialization into a helper function to apply the
correct implementation in both cases without duplicating it.

v2: Added a range check

Reported-by: Ellis Michael <ellis@ellismichael.com>
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Graham Sider <Graham.Sider@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c