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:19:36 +0000 (09:19 +0200)
commitc7a268b33882d5feaafd29c1734456f41ba41396
tree1afb50248193dda1340f8a306b9c638bc05ae4e6
parent2f3e1f38631f8b13f7fa3447313bde3a9692ac5e
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