diff mbox

[1/4] drm/crtc: Remove redundant NULL check before kfree

Message ID 1353318299-3662-1-git-send-email-sachin.kamat@linaro.org (mailing list archive)
State Accepted
Headers show

Commit Message

Sachin Kamat Nov. 19, 2012, 9:44 a.m. UTC
kfree() on a NULL input is a no-op. Hence remove the check.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
This series is build tested on the latest linux-next (20121115).
---
 drivers/gpu/drm/drm_crtc.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

Comments

Sachin Kamat Nov. 21, 2012, 3:12 p.m. UTC | #1
Hi Dave,

Please ignore this patch.


On 19 November 2012 15:14, Sachin Kamat <sachin.kamat@linaro.org> wrote:
> kfree() on a NULL input is a no-op. Hence remove the check.
>
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> ---
> This series is build tested on the latest linux-next (20121115).
> ---
>  drivers/gpu/drm/drm_crtc.c |    6 ++----
>  1 files changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
> index 3533609..807336a 100644
> --- a/drivers/gpu/drm/drm_crtc.c
> +++ b/drivers/gpu/drm/drm_crtc.c
> @@ -470,10 +470,8 @@ void drm_crtc_cleanup(struct drm_crtc *crtc)
>  {
>         struct drm_device *dev = crtc->dev;
>
> -       if (crtc->gamma_store) {
> -               kfree(crtc->gamma_store);
> -               crtc->gamma_store = NULL;
> -       }
> +       kfree(crtc->gamma_store);
> +       crtc->gamma_store = NULL;
>
>         drm_mode_object_put(dev, &crtc->base);
>         list_del(&crtc->head);
> --
> 1.7.4.1
>
Sachin Kamat Nov. 22, 2012, 4:54 a.m. UTC | #2
On 21 November 2012 20:42, Sachin Kamat <sachin.kamat@linaro.org> wrote:
> Hi Dave,
>
> Please ignore this patch.
>
>

Please ignore this mail. Sorry for the noise.
diff mbox

Patch

diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index 3533609..807336a 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -470,10 +470,8 @@  void drm_crtc_cleanup(struct drm_crtc *crtc)
 {
 	struct drm_device *dev = crtc->dev;
 
-	if (crtc->gamma_store) {
-		kfree(crtc->gamma_store);
-		crtc->gamma_store = NULL;
-	}
+	kfree(crtc->gamma_store);
+	crtc->gamma_store = NULL;
 
 	drm_mode_object_put(dev, &crtc->base);
 	list_del(&crtc->head);