]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
drm/amdkfd: Check for potential null return of kmalloc_array()
authorQintaoShen <unSimple1993@163.com>
Thu, 24 Mar 2022 08:26:23 +0000 (16:26 +0800)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 27 Apr 2022 10:00:54 +0000 (12:00 +0200)
commita6fc441d08369ea9fca1a9224096c5e005d46a0c
tree5c4483782c7b780740cb275acdf281aaa7979eb2
parentd6acabd1e7aac13785a0f046ccddcdcd70a69520
drm/amdkfd: Check for potential null return of kmalloc_array()

BugLink: https://bugs.launchpad.net/bugs/1969857
[ Upstream commit ebbb7bb9e80305820dc2328a371c1b35679f2667 ]

As the kmalloc_array() may return null, the 'event_waiters[i].wait' would lead to null-pointer dereference.
Therefore, it is better to check the return value of kmalloc_array() to avoid this confusion.

Signed-off-by: QintaoShen <unSimple1993@163.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/gpu/drm/amd/amdkfd/kfd_events.c