Unverified Commit da4af443 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!10990 drm/amd/display: Add NULL pointer check for kzalloc

parents 80b88a17 414606b9
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -549,11 +549,19 @@ void dcn3_clk_mgr_construct(
	dce_clock_read_ss_info(clk_mgr);

	clk_mgr->base.bw_params = kzalloc(sizeof(*clk_mgr->base.bw_params), GFP_KERNEL);
	if (!clk_mgr->base.bw_params) {
		BREAK_TO_DEBUGGER();
		return;
	}

	/* need physical address of table to give to PMFW */
	clk_mgr->wm_range_table = dm_helpers_allocate_gpu_mem(clk_mgr->base.ctx,
			DC_MEM_ALLOC_TYPE_GART, sizeof(WatermarksExternal_t),
			&clk_mgr->wm_range_table_addr);
	if (!clk_mgr->wm_range_table) {
		BREAK_TO_DEBUGGER();
		return;
	}
}

void dcn3_clk_mgr_destroy(struct clk_mgr_internal *clk_mgr)
+3 −0
Original line number Diff line number Diff line
@@ -2373,6 +2373,9 @@ bool dcn30_validate_bandwidth(struct dc *dc,

	BW_VAL_TRACE_COUNT();

	if (!pipes)
		goto validate_fail;

	out = dcn30_internal_validate_bw(dc, context, pipes, &pipe_cnt, &vlevel, fast_validate);

	if (pipe_cnt == 0)