mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2025-07-19 07:39:54 +02:00
drm/amdgpu: fix dereference after null check
[ Upstream commit b1f7810b05
]
check the pointer hive before use.
Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com>
Reviewed-by: Tim Huang <Tim.Huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
d116bb921e
commit
0aad97bf6d
|
@ -5236,7 +5236,7 @@ int amdgpu_device_gpu_recover(struct amdgpu_device *adev,
|
||||||
* to put adev in the 1st position.
|
* to put adev in the 1st position.
|
||||||
*/
|
*/
|
||||||
INIT_LIST_HEAD(&device_list);
|
INIT_LIST_HEAD(&device_list);
|
||||||
if (!amdgpu_sriov_vf(adev) && (adev->gmc.xgmi.num_physical_nodes > 1)) {
|
if (!amdgpu_sriov_vf(adev) && (adev->gmc.xgmi.num_physical_nodes > 1) && hive) {
|
||||||
list_for_each_entry(tmp_adev, &hive->device_list, gmc.xgmi.head) {
|
list_for_each_entry(tmp_adev, &hive->device_list, gmc.xgmi.head) {
|
||||||
list_add_tail(&tmp_adev->reset_list, &device_list);
|
list_add_tail(&tmp_adev->reset_list, &device_list);
|
||||||
if (gpu_reset_for_dev_remove && adev->shutdown)
|
if (gpu_reset_for_dev_remove && adev->shutdown)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user