[PATCH] drm/dp_mst: Don't return error code when crtc is null

Lyude Paul lyude at redhat.com
Mon Aug 17 15:21:30 UTC 2020


Reviewed-by: Lyude Paul <lyude at redhat.com>

I will go ahead and push this to drm-misc-fixes, thanks!

On Fri, 2020-08-14 at 13:01 -0400, Bhawanpreet Lakha wrote:
> [Why]
> In certain cases the crtc can be NULL and returning -EINVAL causes
> atomic check to fail when it shouln't. This leads to valid
> configurations failing because atomic check fails.
> 
> [How]
> Don't early return if crtc is null
> 
> Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha at amd.com>
> ---
>  drivers/gpu/drm/drm_dp_mst_topology.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c
> b/drivers/gpu/drm/drm_dp_mst_topology.c
> index 70c4b7afed12..bc90a1485699 100644
> --- a/drivers/gpu/drm/drm_dp_mst_topology.c
> +++ b/drivers/gpu/drm/drm_dp_mst_topology.c
> @@ -5037,8 +5037,8 @@ int drm_dp_mst_add_affected_dsc_crtcs(struct
> drm_atomic_state *state, struct drm
>  
>  		crtc = conn_state->crtc;
>  
> -		if (WARN_ON(!crtc))
> -			return -EINVAL;
> +		if (!crtc)
> +			continue;
>  
>  		if (!drm_dp_mst_dsc_aux_for_port(pos->port))
>  			continue;
-- 
Cheers,
	Lyude Paul (she/her)
	Software Engineer at Red Hat



More information about the dri-devel mailing list