]> git.hungrycats.org Git - linux/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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 24 Oct 2022 07:58:20 +0000 (09:58 +0200)
commit5861c094874dc8cdb271f4b40c567afb9267bd24
tree81b27ff791279460200d294d6c0a9fa4d460229c
parent7e8d44956459a8acbffd242d946a7fd02cc6b92b
drm/amdkfd: Fix UBSAN shift-out-of-bounds warning

[ Upstream commit b292cafe2dd02d96a07147e4b160927e8399d5cc ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c