linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] drm/msm: dpu: Fix "WARNING: invalid free of devm_ allocated data"
@ 2018-11-16 11:25 YueHaibing
  2018-11-16 20:22 ` Jordan Crouse
  2018-11-16 21:38 ` Sean Paul
  0 siblings, 2 replies; 3+ messages in thread
From: YueHaibing @ 2018-11-16 11:25 UTC (permalink / raw)
  To: robdclark, airlied, seanpaul
  Cc: linux-kernel, jsanka, jcrouse, linux-arm-msm, dri-devel,
	freedreno, YueHaibing

'dpu_enc' is a member of 'drm_enc'
And 'drm_enc' got allocated with devm_kzalloc in dpu_encoder_init.

This gives this error message:
./drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c:459:1-6:
 WARNING: invalid free of devm_ allocated data

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
index 82c55ef..99526d9 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
@@ -455,8 +455,6 @@ static void dpu_encoder_destroy(struct drm_encoder *drm_enc)
 
 	drm_encoder_cleanup(drm_enc);
 	mutex_destroy(&dpu_enc->enc_lock);
-
-	kfree(dpu_enc);
 }
 
 void dpu_encoder_helper_split_config(
-- 
2.7.0



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

* Re: [PATCH -next] drm/msm: dpu: Fix "WARNING: invalid free of devm_ allocated data"
  2018-11-16 11:25 [PATCH -next] drm/msm: dpu: Fix "WARNING: invalid free of devm_ allocated data" YueHaibing
@ 2018-11-16 20:22 ` Jordan Crouse
  2018-11-16 21:38 ` Sean Paul
  1 sibling, 0 replies; 3+ messages in thread
From: Jordan Crouse @ 2018-11-16 20:22 UTC (permalink / raw)
  To: YueHaibing
  Cc: robdclark, airlied, seanpaul, linux-kernel, jsanka,
	linux-arm-msm, dri-devel, freedreno

On Fri, Nov 16, 2018 at 07:25:26PM +0800, YueHaibing wrote:
> 'dpu_enc' is a member of 'drm_enc'
> And 'drm_enc' got allocated with devm_kzalloc in dpu_encoder_init.
> 
> This gives this error message:
> ./drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c:459:1-6:
>  WARNING: invalid free of devm_ allocated data

I had partial fix of this in my ill-fated patch from a few weeks ago but this
is better.

Reviewed-by: Jordan Crouse <jcrouse@codeaurora.org>

> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>  drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> index 82c55ef..99526d9 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> @@ -455,8 +455,6 @@ static void dpu_encoder_destroy(struct drm_encoder *drm_enc)
>  
>  	drm_encoder_cleanup(drm_enc);
>  	mutex_destroy(&dpu_enc->enc_lock);
> -
> -	kfree(dpu_enc);
>  }
>  
>  void dpu_encoder_helper_split_config(
> -- 
> 2.7.0
> 
> 

-- 
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

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

* Re: [PATCH -next] drm/msm: dpu: Fix "WARNING: invalid free of devm_ allocated data"
  2018-11-16 11:25 [PATCH -next] drm/msm: dpu: Fix "WARNING: invalid free of devm_ allocated data" YueHaibing
  2018-11-16 20:22 ` Jordan Crouse
@ 2018-11-16 21:38 ` Sean Paul
  1 sibling, 0 replies; 3+ messages in thread
From: Sean Paul @ 2018-11-16 21:38 UTC (permalink / raw)
  To: YueHaibing
  Cc: robdclark, airlied, seanpaul, linux-kernel, jsanka, jcrouse,
	linux-arm-msm, dri-devel, freedreno

On Fri, Nov 16, 2018 at 07:25:26PM +0800, YueHaibing wrote:
> 'dpu_enc' is a member of 'drm_enc'

It's the other way around :)

> And 'drm_enc' got allocated with devm_kzalloc in dpu_encoder_init.
> 
> This gives this error message:
> ./drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c:459:1-6:
>  WARNING: invalid free of devm_ allocated data
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Reviewed-by: Sean Paul <sean@poorly.run>

> ---
>  drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> index 82c55ef..99526d9 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> @@ -455,8 +455,6 @@ static void dpu_encoder_destroy(struct drm_encoder *drm_enc)
>  
>  	drm_encoder_cleanup(drm_enc);
>  	mutex_destroy(&dpu_enc->enc_lock);
> -
> -	kfree(dpu_enc);
>  }
>  
>  void dpu_encoder_helper_split_config(
> -- 
> 2.7.0
> 
> 

-- 
Sean Paul, Software Engineer, Google / Chromium OS

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

end of thread, other threads:[~2018-11-16 21:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-16 11:25 [PATCH -next] drm/msm: dpu: Fix "WARNING: invalid free of devm_ allocated data" YueHaibing
2018-11-16 20:22 ` Jordan Crouse
2018-11-16 21:38 ` Sean Paul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).