drm/ast: potential dereference of null pointer
authorJiasheng Jiang <jiasheng@iscas.ac.cn>
Tue, 14 Dec 2021 01:41:26 +0000 (09:41 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Dec 2021 08:30:54 +0000 (09:30 +0100)
commit96bc86cac0a959ca59ed4f4594b298bb110f98ac
treed13f687bb2756fd5d683981b4ae1568aa1d7c464
parentcac0fd4b9bd385b96b6548dcda7e22e03d2694b2
drm/ast: potential dereference of null pointer

[ Upstream commit fea3fdf975dd9f3e5248afaab8fe023db313f005 ]

The return value of kzalloc() needs to be checked.
To avoid use of null pointer '&ast_state->base' in case of the
failure of alloc.

Fixes: f0adbc382b8b ("drm/ast: Allocate initial CRTC state of the correct size")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20211214014126.2211535-1-jiasheng@iscas.ac.cn
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/ast/ast_mode.c