All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][next] drm/amdkfd: fix a dereference of pdd before it is null checked
@ 2020-05-28 22:24 ` Colin King
  0 siblings, 0 replies; 8+ messages in thread
From: Colin King @ 2020-05-28 22:24 UTC (permalink / raw)
  To: Felix Kuehling, Alex Deucher, Christian König, David Airlie,
	Daniel Vetter, Mukul Joshi, amd-gfx, dri-devel
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

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: 522b89c63370 ("drm/amdkfd: Track SDMA utilization per process")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/gpu/drm/amd/amdkfd/kfd_process.c | 5 +++--
 1 file 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 25636789f3d3..bdc58741b32e 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);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-05-29  6:47 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-28 22:24 [PATCH][next] drm/amdkfd: fix a dereference of pdd before it is null checked Colin King
2020-05-28 22:24 ` Colin King
2020-05-28 22:24 ` Colin King
2020-05-28 22:24 ` Colin King
2020-05-29  2:06 ` Felix Kuehling
2020-05-29  2:06   ` Felix Kuehling
2020-05-29  2:06   ` Felix Kuehling
2020-05-29  2:06   ` Felix Kuehling

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.