Commit 039ffeaa authored by zhongshiqi's avatar zhongshiqi Committed by Alex Deucher
Browse files

dc.c:use kzalloc without test



dc.c:583:null check is needed after using kzalloc function

Reviewed-by: default avatarHarry Wentland <harry.wentland@amd.com>
Signed-off-by: default avatarzhongshiqi <zhong.shiqi@zte.com.cn>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent b69cd5dd
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -601,6 +601,10 @@ static bool construct(struct dc *dc,
#ifdef CONFIG_DRM_AMD_DC_DCN2_0
	// Allocate memory for the vm_helper
	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
	memcpy(&dc->bb_overrides, &init_params->bb_overrides, sizeof(dc->bb_overrides));