Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/amdgpu: refine error handling in amdgpu_ttm_tt_pin_userptr

Free sg table when dma_map_sgtable() failed to avoid memory leak.

Signed-off-by: Lang Yu <lang.yu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Lang Yu and committed by
Alex Deucher
46186667 d37bc6a4

+3 -1
+3 -1
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
··· 812 812 /* Map SG to device */ 813 813 r = dma_map_sgtable(adev->dev, ttm->sg, direction, 0); 814 814 if (r) 815 - goto release_sg; 815 + goto release_sg_table; 816 816 817 817 /* convert SG to linear array of pages and dma addresses */ 818 818 drm_prime_sg_to_dma_addr_array(ttm->sg, gtt->ttm.dma_address, ··· 820 820 821 821 return 0; 822 822 823 + release_sg_table: 824 + sg_free_table(ttm->sg); 823 825 release_sg: 824 826 kfree(ttm->sg); 825 827 ttm->sg = NULL;