Op 24-04-2019 om 15:12 schreef kbuild test robot:
> tree:   git://anongit.freedesktop.org/drm/drm-misc for-linux-next-fixes
> head:   d08106796a78a4273e39e1bbdf538dc4334b2635
> commit: d08106796a78a4273e39e1bbdf538dc4334b2635 [1/1] drm/vc4: Fix memory 
> leak during gpu reset.
> reproduce:
>         # apt-get install sparse
>         git checkout d08106796a78a4273e39e1bbdf538dc4334b2635
>         make ARCH=x86_64 allmodconfig
>         make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
>
> If you fix the issue, kindly add following tag
> Reported-by: kbuild test robot <l...@intel.com>
>
> sparse warnings: (new ones prefixed by >>)
>
>>> drivers/gpu/drm/vc4/vc4_crtc.c:1045:44: sparse: sparse: incorrect type in 
>>> argument 1 (different base types) @@    expected struct drm_crtc *crtc @@   
>>>  got structstruct drm_crtc *crtc @@
>>> drivers/gpu/drm/vc4/vc4_crtc.c:1045:44: sparse:    expected struct drm_crtc 
>>> *crtc
>>> drivers/gpu/drm/vc4/vc4_crtc.c:1045:44: sparse:    got struct 
>>> drm_crtc_state *state
>>> drivers/gpu/drm/vc4/vc4_crtc.c:1045:39: sparse: sparse: not enough 
>>> arguments for function vc4_crtc_destroy_state
> vim +1045 drivers/gpu/drm/vc4/vc4_crtc.c
>
>   1040        
>   1041        static void
>   1042        vc4_crtc_reset(struct drm_crtc *crtc)
>   1043        {
>   1044                if (crtc->state)
>> 1045                 vc4_crtc_destroy_state(crtc->state);
>   1046        
>   1047                crtc->state = kzalloc(sizeof(struct vc4_crtc_state), 
> GFP_KERNEL);
>   1048                if (crtc->state)
>   1049                        crtc->state->crtc = crtc;
>   1050        }
>   1051        
>
> ---
> 0-DAY kernel test infrastructure                Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

-----8<----
A pointer to crtc was missing, resulting in the following build error:
drivers/gpu/drm/vc4/vc4_crtc.c:1045:44: sparse: sparse: incorrect type in 
argument 1 (different base types)
drivers/gpu/drm/vc4/vc4_crtc.c:1045:44: sparse:    expected struct drm_crtc 
*crtc
drivers/gpu/drm/vc4/vc4_crtc.c:1045:44: sparse:    got struct drm_crtc_state 
*state
drivers/gpu/drm/vc4/vc4_crtc.c:1045:39: sparse: sparse: not enough arguments 
for function vc4_crtc_destroy_state

Signed-off-by: Maarten Lankhorst <maarten.lankho...@linux.intel.com>
Reported-by: kbuild test robot <l...@intel.com>
Cc: Eric Anholt <e...@anholt.net>
---
 drivers/gpu/drm/vc4/vc4_crtc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c
index e7c04a9eb219..1baa10e94484 100644
--- a/drivers/gpu/drm/vc4/vc4_crtc.c
+++ b/drivers/gpu/drm/vc4/vc4_crtc.c
@@ -1042,7 +1042,7 @@ static void
 vc4_crtc_reset(struct drm_crtc *crtc)
 {
        if (crtc->state)
-               vc4_crtc_destroy_state(crtc->state);
+               vc4_crtc_destroy_state(crtc, crtc->state);
 
        crtc->state = kzalloc(sizeof(struct vc4_crtc_state), GFP_KERNEL);
        if (crtc->state)
-- 
2.20.1


_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Reply via email to