diff options
author | Alex Hung <alex.hung@amd.com> | 2023-01-11 09:54:11 -0700 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2023-03-01 22:43:19 -0500 |
commit | 031f196d1b1b6d5dfcb0533b431e3ab1750e6189 (patch) | |
tree | 6597cb76323e6cddb0cc2d6328febeefe428ee4f /lib/mpi/mpicoder.c | |
parent | 01a18aa309aec12461fb5e6aecb76f8b33810658 (diff) |
drm/amd/display: fix shift-out-of-bounds in CalculateVMAndRowBytes
[WHY]
When PTEBufferSizeInRequests is zero, UBSAN reports the following
warning because dml_log2 returns an unexpected negative value:
shift exponent 4294966273 is too large for 32-bit type 'int'
[HOW]
In the case PTEBufferSizeInRequests is zero, skip the dml_log2() and
assign the result directly.
Reviewed-by: Jun Lei <Jun.Lei@amd.com>
Acked-by: Qingqing Zhuo <qingqing.zhuo@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'lib/mpi/mpicoder.c')
0 files changed, 0 insertions, 0 deletions