]> git.baikalelectronics.ru Git - kernel.git/commit
drm/amdkfd: fix null pointer dereference on dev
authorColin Ian King <colin.king@canonical.com>
Wed, 29 May 2019 15:07:34 +0000 (16:07 +0100)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 29 May 2019 21:50:09 +0000 (16:50 -0500)
commit70116fdfe974af26374c1d1489f137b820a920fc
treeb53ebd525a0c1e79772a47fbeb419035d680bbde
parentf8c599dc0d7174d8989d3b9b1be14506c8cf2432
drm/amdkfd: fix null pointer dereference on dev

The pointer dev is set to null yet it is being dereferenced when
checking dev->dqm->sched_policy.  Fix this by performing the check
on dev->dqm->sched_policy after dev has been assigned and null
checked.  Also remove the redundant null assignment to dev.

Addresses-Coverity: ("Explicit null dereference")
Fixes: 37620ef90e07 ("drm/amdkfd: New IOCTL to allocate queue GWS")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c