drm/msm/disp: check the return value of kzalloc()
authorXiaoke Wang <xkernel.wang@foxmail.com>
Thu, 24 Mar 2022 09:15:08 +0000 (17:15 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 Apr 2022 12:38:55 +0000 (14:38 +0200)
commitf0ba965e47830057c5550b869a5127e8e50136cf
treebc34cbe7bfc0d97bb494e7397c5264b1259b43ff
parentb78d403395682bb69976ade363613803e69fcdff
drm/msm/disp: check the return value of kzalloc()

[ Upstream commit f75e582b0c3ee8f0bddc2248cc8b9175f29c5937 ]

kzalloc() is a memory allocation function which can return NULL when
some internal memory errors happen. So it is better to check it to
prevent potential wrong memory access.

Signed-off-by: Xiaoke Wang <xkernel.wang@foxmail.com>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Link: https://lore.kernel.org/r/tencent_B3E19486FF39415098B572B7397C2936C309@qq.com
Signed-off-by: Rob Clark <robdclark@chromium.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/msm/disp/msm_disp_snapshot_util.c