diff options
| author | Jason-JH.Lin <[email protected]> | 2023-07-14 09:49:06 +0000 |
|---|---|---|
| committer | Chun-Kuang Hu <[email protected]> | 2023-08-10 23:47:49 +0000 |
| commit | d761b9450e31e5abd212f0085d424ed32760de5a (patch) | |
| tree | 7a4356714bc97fe112df1cc453463be58b8dd31f /drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | |
| parent | drm/mediatek: Remove freeing not dynamic allocated memory (diff) | |
| download | kernel-d761b9450e31e5abd212f0085d424ed32760de5a.tar.gz kernel-d761b9450e31e5abd212f0085d424ed32760de5a.zip | |
drm/mediatek: Add cnt checking for coverity issue
CERT-C Characters and Strings (CERT STR31-C)
all_drm_priv[cnt] evaluates to an address that could be at negative
offset of an array.
In mtk_drm_get_all_drm_priv():
Guarantee that storage for strings has sufficient space for character
data and the null terminator.
So change cnt to unsigned int and check its max value.
Fixes: 1ef7ed48356c ("drm/mediatek: Modify mediatek-drm for mt8195 multi mmsys support")
Signed-off-by: Jason-JH.Lin <[email protected]>
Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
Reviewed-by: CK Hu <[email protected]>
Reviewed-by: Alexandre Mergnat <[email protected]>
Link: https://patchwork.kernel.org/project/dri-devel/patch/[email protected]/
Signed-off-by: Chun-Kuang Hu <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_device.c')
0 files changed, 0 insertions, 0 deletions
