diff mbox series

drm/i915/tc: Delete bogus NULL check in intel_ddi_encoder_destroy()

Message ID 20211004103737.GC25015@kili (mailing list archive)
State New, archived
Headers show
Series drm/i915/tc: Delete bogus NULL check in intel_ddi_encoder_destroy() | expand

Commit Message

Dan Carpenter Oct. 4, 2021, 10:37 a.m. UTC
The "digi_port" pointer can't be NULL and we have already dereferenced
it so checking for NULL is not necessary.  Delete the check.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/gpu/drm/i915/display/intel_ddi.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Ville Syrjälä Oct. 5, 2021, 7:26 p.m. UTC | #1
On Mon, Oct 04, 2021 at 01:37:37PM +0300, Dan Carpenter wrote:
> The "digi_port" pointer can't be NULL and we have already dereferenced
> it so checking for NULL is not necessary.  Delete the check.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Thanks. Applied to drm-intel-next.

> ---
>  drivers/gpu/drm/i915/display/intel_ddi.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
> index 51d07e9af9f3..b9c6eb13804f 100644
> --- a/drivers/gpu/drm/i915/display/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/display/intel_ddi.c
> @@ -4025,8 +4025,7 @@ static void intel_ddi_encoder_destroy(struct drm_encoder *encoder)
>  	intel_display_power_flush_work(i915);
>  
>  	drm_encoder_cleanup(encoder);
> -	if (dig_port)
> -		kfree(dig_port->hdcp_port_data.streams);
> +	kfree(dig_port->hdcp_port_data.streams);
>  	kfree(dig_port);
>  }
>  
> -- 
> 2.20.1
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
index 51d07e9af9f3..b9c6eb13804f 100644
--- a/drivers/gpu/drm/i915/display/intel_ddi.c
+++ b/drivers/gpu/drm/i915/display/intel_ddi.c
@@ -4025,8 +4025,7 @@  static void intel_ddi_encoder_destroy(struct drm_encoder *encoder)
 	intel_display_power_flush_work(i915);
 
 	drm_encoder_cleanup(encoder);
-	if (dig_port)
-		kfree(dig_port->hdcp_port_data.streams);
+	kfree(dig_port->hdcp_port_data.streams);
 	kfree(dig_port);
 }