diff options
author | Colin Ian King <colin.king@canonical.com> | 2020-05-29 01:24:53 +0300 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2020-05-29 20:54:38 +0300 |
commit | 2652bda7b4f732e4b2cef82fa7476a7d4b648409 (patch) | |
tree | 2168fff90b4a10c05c63f9ba8777918d6f5a7449 /drivers/gpu/drm/amd/amdkfd/kfd_process.c | |
parent | 48b270bb22dbe27f122ed9b310f23a20d2f39228 (diff) | |
download | linux-2652bda7b4f732e4b2cef82fa7476a7d4b648409.tar.xz |
drm/amdkfd: fix a dereference of pdd before it is null checked
Currently pointer pdd is being dereferenced when assigning pointer
dpm and then pdd is being null checked. Fix this by checking if
pdd is null before the dereference of pdd occurs.
Addresses-Coverity: ("Dereference before null check")
Fixes: 32cb59f31362 ("drm/amdkfd: Track SDMA utilization per process")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdkfd/kfd_process.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdkfd/kfd_process.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process.c b/drivers/gpu/drm/amd/amdkfd/kfd_process.c index db010c5da144..a9a7f5aa2710 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_process.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_process.c @@ -103,10 +103,11 @@ static void kfd_sdma_activity_worker(struct work_struct *work) return; pdd = workarea->pdd; + if (!pdd) + return; dqm = pdd->dev->dqm; qpd = &pdd->qpd; - - if (!pdd || !dqm || !qpd) + if (!dqm || !qpd) return; mm = get_task_mm(pdd->process->lead_thread); |