drm/amdkfd: Fix UBSAN shift-out-of-bounds warning
If get_num_sdma_queues or get_num_xgmi_sdma_queues is 0, we end up doing a shift operation where the number of bits shifted equals number of bits in the operand. This behaviour is undefined. Set num_sdma_queues or num_xgmi_sdma_queues to ULLONG_MAX, if the count is >= number of bits in the operand. Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1472Reported-by:Lyude Paul <lyude@redhat.com> Signed-off-by:
Anson Jacob <Anson.Jacob@amd.com> Reviewed-by:
Alex Deucher <alexander.deucher@amd.com> Reviewed-by:
Felix Kuehling <Felix.Kuehling@amd.com> Tested-by:
Lyude Paul <lyude@redhat.com> Signed-off-by:
Alex Deucher <alexander.deucher@amd.com>
Showing
Please register or sign in to comment