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:34:15 +0000 (09:34 +0200)
commitf2658d5966bcee8c3eb487875f459756d4f7cdfc
tree1440c4066158df6277e375de20a6f1e0882c28d7
parent9f0fabf30b486e3d5c9b578073cea369ffc05c43
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