[PATCH] drm/amdgpu: Fix possible NULL pointer dereference

2024-10-29 Thread Li Huafei
Fix the potential NULL pointer dereference on mem_ranges in amdgpu_discovery_get_nps_info(). Additionally, assign the output parameters nps_type and range_cnt after the kvzalloc() call to prevent modifying the output parameters in case of an error return. Fixes: b194d21b9bcc ("drm/amdgpu: Use NPS

Re: [PATCH] drm/amdgpu: Fix possible NULL pointer dereference

2024-10-29 Thread Li Huafei
On 2024/10/28 22:33, Lazar, Lijo wrote: > > > On 10/29/2024 3:29 AM, Li Huafei wrote: >> Fix the potential NULL pointer dereference on mem_ranges in >> amdgpu_discovery_get_nps_info(). Additionally, assign the output >> parameters nps_type and range_cnt after the kvzalloc() call to prevent >>

Re: [PATCH] drm/amdgpu: Fix possible NULL pointer dereference

2024-10-28 Thread Lazar, Lijo
On 10/29/2024 3:29 AM, Li Huafei wrote: > Fix the potential NULL pointer dereference on mem_ranges in > amdgpu_discovery_get_nps_info(). Additionally, assign the output > parameters nps_type and range_cnt after the kvzalloc() call to prevent > modifying the output parameters in case of an error

Re: [PATCH] drm/amdgpu: fix possible null-pointer dereference in amdgpu_ttm_tt_populate()

2021-08-02 Thread Li Tuo
Thanks for your feedback! We will remove the null tests according to your advice and prepare a V2 patch. Best wishes, Tuo Li On 2021/8/2 1:19, Christian König wrote: Am 31.07.21 um 10:04 schrieb Tuo Li: The variable ttm is assigned to the variable gtt, and the variable gtt is checked in:    i

Re: [PATCH] drm/amdgpu: fix possible null-pointer dereference in amdgpu_ttm_tt_unpopulate()

2021-08-01 Thread Christian König
Am 31.07.21 um 10:13 schrieb Tuo Li: The variable ttm is assigned to the variable gtt, and the variable gtt is checked in: if (gtt && gtt->userptr) This indicates that both ttm and gtt can be NULL. If so, a null-pointer dereference will occur: if (ttm->page_flags & TTM_PAGE_FLAG_SG) Also,

Re: [PATCH] drm/amdgpu: fix possible null-pointer dereference in amdgpu_ttm_tt_populate()

2021-08-01 Thread Christian König
Am 31.07.21 um 10:04 schrieb Tuo Li: The variable ttm is assigned to the variable gtt, and the variable gtt is checked in: if (gtt && gtt->userptr) This indicates that both ttm and gtt can be NULL. If so, a null-pointer dereference will occur: if (ttm->page_flags & TTM_PAGE_FLAG_SG) Also,

[PATCH] drm/amdgpu: fix possible null-pointer dereference in amdgpu_ttm_tt_populate()

2021-07-31 Thread Tuo Li
The variable ttm is assigned to the variable gtt, and the variable gtt is checked in: if (gtt && gtt->userptr) This indicates that both ttm and gtt can be NULL. If so, a null-pointer dereference will occur: if (ttm->page_flags & TTM_PAGE_FLAG_SG) Also, some null-pointer dereferences will occu

[PATCH] drm/amdgpu: fix possible null-pointer dereference in amdgpu_ttm_tt_unpopulate()

2021-07-31 Thread Tuo Li
The variable ttm is assigned to the variable gtt, and the variable gtt is checked in: if (gtt && gtt->userptr) This indicates that both ttm and gtt can be NULL. If so, a null-pointer dereference will occur: if (ttm->page_flags & TTM_PAGE_FLAG_SG) Also, some null-pointer dereferences will occu