drm/amdkfd: Check for potential null return of kmalloc_array()
stable inclusion from stable-v5.10.112 commit 1d7a5aae884ca727d41c7ed15d4c82fdb67c040c category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I5HL0X Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=1d7a5aae884ca727d41c7ed15d4c82fdb67c040c -------------------------------- [ Upstream commit ebbb7bb9 ] 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: NQintaoShen <unSimple1993@163.com> Signed-off-by: NAlex Deucher <alexander.deucher@amd.com> Signed-off-by: NSasha Levin <sashal@kernel.org> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com> Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
Showing
想要评论请 注册 或 登录