提交 364593f3 编写于 作者: Z zhongshiqi 提交者: Alex Deucher

dc.c:use kzalloc without test

dc.c:583:null check is needed after using kzalloc function
Reviewed-by: NHarry Wentland <harry.wentland@amd.com>
Signed-off-by: Nzhongshiqi <zhong.shiqi@zte.com.cn>
Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
上级 385857ad
...@@ -580,6 +580,10 @@ static bool construct(struct dc *dc, ...@@ -580,6 +580,10 @@ static bool construct(struct dc *dc,
#ifdef CONFIG_DRM_AMD_DC_DCN2_0 #ifdef CONFIG_DRM_AMD_DC_DCN2_0
// Allocate memory for the vm_helper // Allocate memory for the vm_helper
dc->vm_helper = kzalloc(sizeof(struct vm_helper), GFP_KERNEL); dc->vm_helper = kzalloc(sizeof(struct vm_helper), GFP_KERNEL);
if (!dc->vm_helper) {
dm_error("%s: failed to create dc->vm_helper\n", __func__);
goto fail;
}
#endif #endif
memcpy(&dc->bb_overrides, &init_params->bb_overrides, sizeof(dc->bb_overrides)); memcpy(&dc->bb_overrides, &init_params->bb_overrides, sizeof(dc->bb_overrides));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册