dma_addr calculations are carried out using 32-bit arithmetic, which could cause a truncation of the values before they are extended to 64 bits. Cast one of the operands to dma_addr_t, so 64-bit arithmetic is used.
Signed-off-by: Krzysztof Karas <[email protected]> --- drivers/gpu/drm/drm_fb_dma_helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_fb_dma_helper.c b/drivers/gpu/drm/drm_fb_dma_helper.c index 2b2513188001..c3b9e49bd755 100644 --- a/drivers/gpu/drm/drm_fb_dma_helper.c +++ b/drivers/gpu/drm/drm_fb_dma_helper.c @@ -104,8 +104,8 @@ dma_addr_t drm_fb_dma_get_gem_addr(struct drm_framebuffer *fb, block_start_y = (sample_y / block_h) * block_h; num_hblocks = sample_x / block_w; - dma_addr += fb->pitches[plane] * block_start_y; - dma_addr += block_size * num_hblocks; + dma_addr += (dma_addr_t)fb->pitches[plane] * block_start_y; + dma_addr += (dma_addr_t)block_size * num_hblocks; return dma_addr; } -- 2.34.1
