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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Apr 2022 07:12:49 +0000 (09:12 +0200)
commit94869bb0de69a812f70231b0eb480bb2f7ae73a6
treed3e9e61e30db48c3f8f99cccded2cece30cae043
parentce07ef076e52096569e152abf4c82c8044df82f6
drm/amdkfd: Check for potential null return of kmalloc_array()

[ 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>
drivers/gpu/drm/amd/amdkfd/kfd_events.c