[U-Boot] [RFC PATCH 06/12] devres: introduce Devres (Managed Device Resource) framework

Albert ARIBAUD albert.u.boot at aribaud.net
Thu Jul 9 17:03:56 CEST 2015


Hello Simon,

On Thu, 9 Jul 2015 07:31:05 -0600, Simon Glass <sjg at chromium.org> wrote:
> Hi,
> 
> On 8 July 2015 at 23:41, Albert ARIBAUD <albert.u.boot at aribaud.net> wrote:
> > Hello Masahiro,
> >
> > On Thu, 9 Jul 2015 14:16:33 +0900, Masahiro Yamada
> > <yamada.masahiro at socionext.com> wrote:
> >> Hi Simon,
> >>
> >> > 3. How do we handle things like gpio_exynos_bind() which allocs some
> >> > data and passes it to a device it creates, as platform data? At
> >> > present we don't free it.
> >>
> >> So, currently this driver is leaking the memory, isn't it?
> >>
> >> If we use devm_kzalloc() here, the platdata for GPIOs
> >> will be released when the parent pinctrl is unbound.
> >
> > Does gpio_exynos_bind() get called enough between entry and exit from
> > U-boot that the memory leaks prevent U-Boot from doing its job properly?
> 
> No we only bind devices once in U-Boot, except for USB which recently changed.

Then I'll be the Devil's advocate and question the interest of adding
code in U-Boot to fix a leak which, when it happens at all, does not
substantially affect U-Boot's functionality.

Amicalement,
-- 
Albert.


More information about the U-Boot mailing list