All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/gma500:  Remove null check before kfree
@ 2017-08-30 13:25 Himanshu Jha
  2017-08-31  7:52 ` Daniel Vetter
  0 siblings, 1 reply; 2+ messages in thread
From: Himanshu Jha @ 2017-08-30 13:25 UTC (permalink / raw)
  To: patrik.r.jakobsson; +Cc: airlied, dri-devel, linux-kernel, Himanshu Jha

kfree on NULL pointer is a no-op and therefore checking is redundant.

Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
---
 drivers/gpu/drm/gma500/cdv_intel_dp.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/gma500/cdv_intel_dp.c b/drivers/gpu/drm/gma500/cdv_intel_dp.c
index c52f9ad..a4bb89b 100644
--- a/drivers/gpu/drm/gma500/cdv_intel_dp.c
+++ b/drivers/gpu/drm/gma500/cdv_intel_dp.c
@@ -1901,10 +1901,8 @@ cdv_intel_dp_destroy(struct drm_connector *connector)
 
 	if (is_edp(gma_encoder)) {
 	/*	cdv_intel_panel_destroy_backlight(connector->dev); */
-		if (intel_dp->panel_fixed_mode) {
-			kfree(intel_dp->panel_fixed_mode);
-			intel_dp->panel_fixed_mode = NULL;
-		}
+		kfree(intel_dp->panel_fixed_mode);
+		intel_dp->panel_fixed_mode = NULL;
 	}
 	i2c_del_adapter(&intel_dp->adapter);
 	drm_connector_unregister(connector);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/gma500:  Remove null check before kfree
  2017-08-30 13:25 [PATCH] drm/gma500: Remove null check before kfree Himanshu Jha
@ 2017-08-31  7:52 ` Daniel Vetter
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Vetter @ 2017-08-31  7:52 UTC (permalink / raw)
  To: Himanshu Jha; +Cc: patrik.r.jakobsson, linux-kernel, dri-devel

On Wed, Aug 30, 2017 at 06:55:56PM +0530, Himanshu Jha wrote:
> kfree on NULL pointer is a no-op and therefore checking is redundant.
> 
> Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>

Applied to drm-misc-next, thanks.
-Daniel

> ---
>  drivers/gpu/drm/gma500/cdv_intel_dp.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/gma500/cdv_intel_dp.c b/drivers/gpu/drm/gma500/cdv_intel_dp.c
> index c52f9ad..a4bb89b 100644
> --- a/drivers/gpu/drm/gma500/cdv_intel_dp.c
> +++ b/drivers/gpu/drm/gma500/cdv_intel_dp.c
> @@ -1901,10 +1901,8 @@ cdv_intel_dp_destroy(struct drm_connector *connector)
>  
>  	if (is_edp(gma_encoder)) {
>  	/*	cdv_intel_panel_destroy_backlight(connector->dev); */
> -		if (intel_dp->panel_fixed_mode) {
> -			kfree(intel_dp->panel_fixed_mode);
> -			intel_dp->panel_fixed_mode = NULL;
> -		}
> +		kfree(intel_dp->panel_fixed_mode);
> +		intel_dp->panel_fixed_mode = NULL;
>  	}
>  	i2c_del_adapter(&intel_dp->adapter);
>  	drm_connector_unregister(connector);
> -- 
> 2.7.4
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-08-31  7:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-30 13:25 [PATCH] drm/gma500: Remove null check before kfree Himanshu Jha
2017-08-31  7:52 ` Daniel Vetter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.