]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drm/mediatek: Fix coverity issue with unintentional integer overflow
authorJason-JH.Lin <jason-jh.lin@mediatek.com>
Thu, 7 Sep 2023 09:14:25 +0000 (17:14 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 20 Nov 2023 10:56:59 +0000 (11:56 +0100)
commit0d8a1df39d3fc34560e2cc663b5c340d06a25396
treed726254fe1c0a5c3a085d231adc6c0c2cb5b046c
parent66e2bbbacaf8c24c77be202e29579f25061c4b86
drm/mediatek: Fix coverity issue with unintentional integer overflow

[ Upstream commit b0b0d811eac6b4c52cb9ad632fa6384cf48869e7 ]

1. Instead of multiplying 2 variable of different types. Change to
assign a value of one variable and then multiply the other variable.

2. Add a int variable for multiplier calculation instead of calculating
different types multiplier with dma_addr_t variable directly.

Fixes: 1a64a7aff8da ("drm/mediatek: Fix cursor plane no update")
Signed-off-by: Jason-JH.Lin <jason-jh.lin@mediatek.com>
Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://patchwork.kernel.org/project/dri-devel/patch/20230907091425.9526-1-jason-jh.lin@mediatek.com/
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/mediatek/mtk_drm_gem.c
drivers/gpu/drm/mediatek/mtk_drm_plane.c