[Intel-gfx] [PATCH] drm/fb-helper: Automatically clean up fb_info

Daniel Vetter daniel at ffwll.ch
Tue Feb 7 16:09:08 UTC 2017


On Tue, Feb 07, 2017 at 02:49:38PM +0000, Chris Wilson wrote:
> On Tue, Feb 07, 2017 at 02:38:16PM +0000, Emil Velikov wrote:
> > On 7 February 2017 at 14:29, Daniel Vetter <daniel.vetter at ffwll.ch> wrote:
> > > Noticed that everyone duplicates the same logic here and we could safe
> > > a few lines per driver. Yay for lots of drivers to make such tiny
> > > refactors worth-while!
> > >
> > > v2: Forgot to git add everything :(
> > >
> > Hmm afaict this patch inlines drm_fb_helper_release_fbi within
> > drm_fb_helper_fini yet it is missing:
> >  - removal of the (now unused ?) drm_fb_helper_release_fbi

Uh right, somehow I forgot about that one ...

> >  - the leaks which now occur in the error paths.
> 
> The error cleanup is a bit unobvious. The fbi is allocated during the
> create/initial_fb callback, which is after a successful
> framebuffer_init. The caller must be prepared to do a framebuffer_fini
> (and so release_fbi will be handled if required) on failure or success.

Yup, Chris is right, and I updated the kerneldoc to explain this.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


More information about the Intel-gfx mailing list