Re: [PATCH 1/3] drm/dp/mst: Handle errors from drm_atomic_get_private_obj_state() correctly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2017-07-12 at 18:51 +0300, ville.syrjala@xxxxxxxxxxxxxxx wrote:
> From: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>
> 
> On failure drm_atomic_get_private_obj_state() returns and error
> pointer instead of NULL. Adjust the checks in the callers to match.
> 
> Cc: stable@xxxxxxxxxxxxxxx
> Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@xxxxxxxxx>
> Cc: Harry Wentland <harry.wentland@xxxxxxx>
> Cc: Maarten Lankhorst <maarten.lankhorst@xxxxxxxxxxxxxxx>

Thanks for fixing this, 
Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@xxxxxxxxx>

> Fixes: edb1ed1ab7d3 ("drm/dp: Add DP MST helpers to atomically find and release vcpi slots")
> Signed-off-by: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>
> ---
>  drivers/gpu/drm/drm_dp_mst_topology.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c
> index bfd237c15e76..18cecd94acb6 100644
> --- a/drivers/gpu/drm/drm_dp_mst_topology.c
> +++ b/drivers/gpu/drm/drm_dp_mst_topology.c
> @@ -2515,8 +2515,8 @@ int drm_dp_atomic_find_vcpi_slots(struct drm_atomic_state *state,
>  	int req_slots;
>  
>  	topology_state = drm_atomic_get_mst_topology_state(state, mgr);
> -	if (topology_state == NULL)
> -		return -ENOMEM;
> +	if (IS_ERR(topology_state))
> +		return PTR_ERR(topology_state);
>  
>  	port = drm_dp_get_validated_port_ref(mgr, port);
>  	if (port == NULL)
> @@ -2555,8 +2555,8 @@ int drm_dp_atomic_release_vcpi_slots(struct drm_atomic_state *state,
>  	struct drm_dp_mst_topology_state *topology_state;
>  
>  	topology_state = drm_atomic_get_mst_topology_state(state, mgr);
> -	if (topology_state == NULL)
> -		return -ENOMEM;
> +	if (IS_ERR(topology_state))
> +		return PTR_ERR(topology_state);
>  
>  	/* We cannot rely on port->vcpi.num_slots to update
>  	 * topology_state->avail_slots as the port may not exist if the parent
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux