Commit c6bce984 authored by Hersen Wu's avatar Hersen Wu Committed by Alex Deucher

drm/amd/display: Add NULL check within get_target_mpc_factor

[Why] Coverity reports NULL_RETURN warning.

[How] Add pointer NULL check.
Reviewed-by: default avatarRodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: default avatarHersen Wu <hersenxs.wu@amd.com>
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 67a4888d
......@@ -819,7 +819,16 @@ static unsigned int get_target_mpc_factor(struct dml2_context *ctx,
/* get stream id of main stream */
main_stream = ctx->config.svp_pstate.callbacks.get_paired_subvp_stream(state, stream);
if (!main_stream) {
ASSERT(false);
return 1;
}
main_stream_status = ctx->config.callbacks.get_stream_status(state, main_stream);
if (!main_stream_status) {
ASSERT(false);
return 1;
}
/* get plane id for associated main plane */
get_plane_id(ctx, state, main_stream_status->plane_states[plane_idx],
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment