]> git.baikalelectronics.ru Git - kernel.git/commit
drm: amdgpu: Use the correct size when allocating memory
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sun, 9 Aug 2020 20:34:06 +0000 (22:34 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 10 Aug 2020 21:19:12 +0000 (17:19 -0400)
commitfe1d67a2e82cc8ac1e9669866d8bd69c97499ce5
tree03ab87907761feb27f83f1d79dd579bfcb487888
parent3dd4f0dee97d4e8ae434e3673a4f8845af4e9071
drm: amdgpu: Use the correct size when allocating memory

When '*sgt' is allocated, we must allocated 'sizeof(**sgt)' bytes instead
of 'sizeof(*sg)'.

The sizeof(*sg) is bigger than sizeof(**sgt) so this wastes memory but
it won't lead to corruption.

Fixes: 4ff30ea1f771 ("drm/amdgpu: add support for exporting VRAM using DMA-buf v3")
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c