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

!12829 drm/amd/display: Check null-initialized variables

parents f2ef49da dd6bd0a3
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -932,7 +932,8 @@ static bool subvp_drr_schedulable(struct dc *dc, struct dc_state *context)
	 * for VBLANK: (VACTIVE region of the SubVP pipe can fit the MALL prefetch, VBLANK frame time,
	 * and the max of (VBLANK blanking time, MALL region)).
	 */
	if (stretched_drr_us < (1 / (double)drr_timing->min_refresh_in_uhz) * 1000000 * 1000000 &&
	if (drr_timing &&
	    stretched_drr_us < (1 / (double)drr_timing->min_refresh_in_uhz) * 1000000 * 1000000 &&
	    subvp_active_us - prefetch_us - stretched_drr_us - max_vblank_mallregion > 0)
		schedulable = true;

@@ -995,7 +996,7 @@ static bool subvp_vblank_schedulable(struct dc *dc, struct dc_state *context)
		if (!subvp_pipe && pipe->stream->mall_stream_config.type == SUBVP_MAIN)
			subvp_pipe = pipe;
	}
	if (found) {
	if (found && subvp_pipe) {
		main_timing = &subvp_pipe->stream->timing;
		phantom_timing = &subvp_pipe->stream->mall_stream_config.paired_stream->timing;
		vblank_timing = &context->res_ctx.pipe_ctx[vblank_index].stream->timing;