Skip to contentSkip to conversation

drm/amdkfd: Track SDMA utilization per process

bug report Dan Carpenter 1 participant 1 message May 29, 2020

lore
Share & tools
lore
#0 lore raw

Hello Mukul Joshi,

This is a semi-automatic email about new static checker warnings.

The patch 522b89c63370: "drm/amdkfd: Track SDMA utilization per process" from May 26, 2020, leads to the following Smatch complaint:

drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_process.c:109 kfd_sdma_activity_worker()
warn: variable dereferenced before check 'pdd' (see line 106)

drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_process.c:109 kfd_sdma_activity_worker()
warn: address of 'pdd->qpd' is non-NULL

drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_process.c
105 pdd = workarea->pdd;

   106		dqm = pdd->dev->dqm;
                      ^^^^^^^^

Dereference.

107 qpd = &pdd->qpd;
108
109 if (!pdd || !dqm || !qpd)

                     ^^^             ^^^

pdd is checked too late and qpd can't possibly be NULL.

110 return;
111

regards,
dan carpenter
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx