drm/msm: dpu: Fix "WARNING: invalid free of devm_ allocated data"
authorYueHaibing <yuehaibing@huawei.com>
Fri, 16 Nov 2018 11:25:26 +0000 (19:25 +0800)
committerSean Paul <seanpaul@chromium.org>
Mon, 3 Dec 2018 13:46:14 +0000 (08:46 -0500)
'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>
Signed-off-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c

index 96cdf06e7da21d8f5bf576014f149f2efbbc7298..d31d8281424efb371cf04cfe82220ef3959828fa 100644 (file)
@@ -488,8 +488,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(