Re: [PATCH] drm/i915/display: use IS_ERR_OR_NULL macro on DP tunnel mgr creation failure

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

 



Hi Krzysztof,

On Wed, Dec 11, 2024 at 09:56:50AM +0000, Krzysztof Karas wrote:
> drm_dp_tunnel_mgr_create() may return NULL on failure, which will not
> be caught via IS_ERR(), so replace it with IS_ERR_OR_NULL() macro.
> 
> Signed-off-by: Krzysztof Karas <krzysztof.karas@xxxxxxxxx>

Fixes: 91888b5b1ad2 ("drm/i915/dp: Add support for DP tunnel BW allocation")
Cc: Imre Deak <imre.deak@xxxxxxxxx>
Cc: <stable@xxxxxxxxxxxxxxx> # v6.9+

> ---
>  drivers/gpu/drm/i915/display/intel_dp_tunnel.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_dp_tunnel.c b/drivers/gpu/drm/i915/display/intel_dp_tunnel.c
> index 94198bc04939..6c960416f776 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp_tunnel.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp_tunnel.c
> @@ -793,7 +793,7 @@ int intel_dp_tunnel_mgr_init(struct intel_display *display)
>  	drm_connector_list_iter_end(&connector_list_iter);
>  
>  	tunnel_mgr = drm_dp_tunnel_mgr_create(display->drm, dp_connectors);
> -	if (IS_ERR(tunnel_mgr))
> +	if (IS_ERR_OR_NULL(tunnel_mgr))

nicely spotted, but the fix is wrong. drm_dp_tunnel_mgr_create()
returns NULL, not an error, so that you can just check:

	if (!tunnel_mgr)
		...

Thanks,
Andi

>  		return PTR_ERR(tunnel_mgr);
>  
>  	display->dp_tunnel_mgr = tunnel_mgr;
> -- 
> 2.34.1



[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux