From mboxrd@z Thu Jan 1 00:00:00 1970 From: Albert ARIBAUD Date: Thu, 9 Jul 2015 17:03:56 +0200 Subject: [U-Boot] [RFC PATCH 06/12] devres: introduce Devres (Managed Device Resource) framework In-Reply-To: References: <1436329782-9179-1-git-send-email-yamada.masahiro@socionext.com> <1436329782-9179-7-git-send-email-yamada.masahiro@socionext.com> <20150709074104.78d2dd25@lilith> Message-ID: <20150709170356.379e2749@lilith> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello Simon, On Thu, 9 Jul 2015 07:31:05 -0600, Simon Glass wrote: > Hi, > > On 8 July 2015 at 23:41, Albert ARIBAUD wrote: > > Hello Masahiro, > > > > On Thu, 9 Jul 2015 14:16:33 +0900, Masahiro Yamada > > 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.