aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
diff options
context:
space:
mode:
authorFelix Kuehling <Felix.Kuehling@amd.com>2018-11-20 20:52:37 -0500
committerAlex Deucher <alexander.deucher@amd.com>2018-12-07 18:13:48 -0500
commit3704d56e1a64bb0e951815f91149ae7bb726aa76 (patch)
tree2adc25a157b1bab7c9984b94dbeef11c9d40fc72 /drivers/gpu/drm/amd/amdkfd/kfd_topology.c
parentdrm/amdgpu: Add KFD VRAM limit checking (diff)
downloadlinux-dev-3704d56e1a64bb0e951815f91149ae7bb726aa76.tar.xz
linux-dev-3704d56e1a64bb0e951815f91149ae7bb726aa76.zip
drm/amdkfd: Add NULL-pointer check
top_dev->gpu is NULL for CPUs. Avoid dereferencing it if NULL. Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to '')
-rw-r--r--drivers/gpu/drm/amd/amdkfd/kfd_topology.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
index aa793fcbbdcc..c5ed21ef2462 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
@@ -101,7 +101,7 @@ struct kfd_dev *kfd_device_by_pci_dev(const struct pci_dev *pdev)
down_read(&topology_lock);
list_for_each_entry(top_dev, &topology_device_list, list)
- if (top_dev->gpu->pdev == pdev) {
+ if (top_dev->gpu && top_dev->gpu->pdev == pdev) {
device = top_dev->gpu;
break;
}