[Intel-gfx] [drm-intel:drm-intel-nightly 1066/1091] drivers/gpu/drm/drm_plane.c:933:48-49: ERROR: reference preceded by free on line 926 (fwd)

Daniel Vetter daniel at ffwll.ch
Thu Mar 30 07:52:33 UTC 2017


On Wed, Mar 29, 2017 at 10:47:34PM +0200, Julia Lawall wrote:
> The kfree on line 926 would only be a problem for the references to e on
> lines 933 and 937 if the return value of drm_event_reserve_init can be
> -EDEADLK.

It cannot, but would indeed be prudent to reset to NULL, like we do at the
top of the function. I'll type the patch.
-Daniel

> 
> julia
> 
> ---------- Forwarded message ----------
> Date: Thu, 30 Mar 2017 00:48:54 +0800
> From: kbuild test robot <fengguang.wu at intel.com>
> To: kbuild at 01.org
> Cc: Julia Lawall <julia.lawall at lip6.fr>
> Subject: [drm-intel:drm-intel-nightly 1066/1091]
>     drivers/gpu/drm/drm_plane.c:933:48-49: ERROR: reference preceded by free on
>     line 926
> 
> tree:   git://anongit.freedesktop.org/drm-intel drm-intel-nightly
> head:   2f9f22b419350cafb06ba7e5342bc461fcb0afca
> commit: 29dc0d1de18239cf3ef8bab578b8321ed340d81c [1066/1091] drm: Roll out acquire context for the page_flip ioctl
> :::::: branch date: 4 hours ago
> :::::: commit date: 9 hours ago
> 
> >> drivers/gpu/drm/drm_plane.c:933:48-49: ERROR: reference preceded by free on line 926
>    drivers/gpu/drm/drm_plane.c:937:41-42: ERROR: reference preceded by free on line 926
> 
> git remote add drm-intel git://anongit.freedesktop.org/drm-intel
> git remote update drm-intel
> git checkout 29dc0d1de18239cf3ef8bab578b8321ed340d81c
> vim +933 drivers/gpu/drm/drm_plane.c
> 
> 43968d7b Daniel Vetter 2016-09-21  920  		}
> 43968d7b Daniel Vetter 2016-09-21  921  		e->event.base.type = DRM_EVENT_FLIP_COMPLETE;
> 43968d7b Daniel Vetter 2016-09-21  922  		e->event.base.length = sizeof(e->event);
> 43968d7b Daniel Vetter 2016-09-21  923  		e->event.user_data = page_flip->user_data;
> 43968d7b Daniel Vetter 2016-09-21  924  		ret = drm_event_reserve_init(dev, file_priv, &e->base, &e->event.base);
> 43968d7b Daniel Vetter 2016-09-21  925  		if (ret) {
> 43968d7b Daniel Vetter 2016-09-21 @926  			kfree(e);
> 43968d7b Daniel Vetter 2016-09-21  927  			goto out;
> 43968d7b Daniel Vetter 2016-09-21  928  		}
> 43968d7b Daniel Vetter 2016-09-21  929  	}
> 43968d7b Daniel Vetter 2016-09-21  930
> 43968d7b Daniel Vetter 2016-09-21  931  	crtc->primary->old_fb = crtc->primary->fb;
> 43968d7b Daniel Vetter 2016-09-21  932  	if (crtc->funcs->page_flip_target)
> 43968d7b Daniel Vetter 2016-09-21 @933  		ret = crtc->funcs->page_flip_target(crtc, fb, e,
> 43968d7b Daniel Vetter 2016-09-21  934  						    page_flip->flags,
> 43968d7b Daniel Vetter 2016-09-21  935  						    target_vblank);
> 43968d7b Daniel Vetter 2016-09-21  936  	else
> 
> :::::: The code at line 933 was first introduced by commit
> :::::: 43968d7b806d7a7e021261294c583a216fddf0e5 drm: Extract drm_plane.[hc]
> 
> :::::: TO: Daniel Vetter <daniel.vetter at ffwll.ch>
> :::::: CC: Sean Paul <seanpaul at chromium.org>
> 
> ---
> 0-DAY kernel test infrastructure                Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

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


More information about the Intel-gfx mailing list